Python Forum

Full Version: Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
>>> import unittest
>>> def main():
unitttest.installhandler()

>>> main()

Traceback (most recent call last):
  File "<pyshell#165>", line 1, in <module>
    main()
  File "<pyshell#164>", line 2, in main
    unitttest.installhandler()
NameError: global name 'unitttest' is not defined
>>> 
you have extra t in unittest in
unitttest.installhandler()
not that this is the right sub-forum for this question
Yes, I had realized it and was in a process of editing the post but could not do so after 10 minutes after post.

Request: Will you please let me know where this can be posted.

When same code (corrected one), an error is encountered -

Place below code in a file -

import unittest

def main():
unittest.installhandler()

if __name__ == '__main__':
main()


And then run it, will give attribute error for "module" object which I could not decipher.

>>> ================================ RESTART ================================
>>>

Traceback (most recent call last):
File "D:\p1.py", line 7, in <module>
main()
File "D:\p1.py", line 4, in main
unittest.installhandler()
AttributeError: 'module' object has no attribute 'installhandler'
>>>
it is
unittest.installHandler()