Python Forum
Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Facing an issue in doing 'unittest.installHandler()' which will send 'stop' signal to
#1
>>> 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
>>> 
Reply
#2
you have extra t in unittest in
unitttest.installhandler()
not that this is the right sub-forum for this question
Reply
#3
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'
>>>
Reply
#4
it is
unittest.installHandler()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in using unittest akbarza 2 314 Feb-25-2024, 12:51 PM
Last Post: deanhystad
  Facing issue in python regex newline match Shr 6 1,298 Oct-25-2023, 09:42 AM
Last Post: Shr
Question Unwanted execution of unittest ThomasFab 9 2,057 Nov-15-2022, 05:33 PM
Last Post: snippsat
  Facing problem with Pycharm - Not getting the expected output amortal03 1 858 Sep-09-2022, 05:44 PM
Last Post: Yoriz
  unittest.mock for an api key silver 3 1,392 Aug-29-2022, 03:52 PM
Last Post: ndc85430
  Facing Problem while opening a file through command prompt vlearner 4 1,909 Jan-30-2022, 08:10 AM
Last Post: snippsat
  Ran 0 tests in 0.000s - unittest Peaches 8 5,103 Dec-31-2021, 08:58 AM
Last Post: Peaches
  Facing error while executing below Python code ramu4651 1 5,735 Jan-26-2021, 06:40 PM
Last Post: ibreeden
  I want to create small multiples grouped bar plot, and facing some aesthetics issuess dev_kaur 0 1,619 Dec-05-2020, 08:49 AM
Last Post: dev_kaur
Sad Problem with Unittest mhanusek 1 3,763 Nov-12-2020, 04:58 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020