Python Forum
Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to (/thread-1764.html)



Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to - hmarne - Jan-24-2017

>>> 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
>>> 


RE: Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to - buran - Jan-24-2017

you have extra t in unittest in
unitttest.installhandler()
not that this is the right sub-forum for this question


RE: Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to - hmarne - Jan-24-2017

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'
>>>


RE: Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to - buran - Jan-24-2017

it is
unittest.installHandler()