Unittest causing sys.exit()

前端 未结 6 875
死守一世寂寞
死守一世寂寞 2020-12-08 16:03

No matter what I do sys.exit() is called by unittest, even the most trivial examples. I can\'t tell if my install is messed up or what is going on.

IDLE 1.2         


        
6条回答
  •  失恋的感觉
    2020-12-08 16:38

    Your example is exiting on my install too. I can make it execute the tests and stay within Python by changing

    unittest.main()
    

    to

    unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromTestCase(Test))
    

    More information is available here in the Python Library Reference.

提交回复
热议问题