Unittest causing sys.exit()

前端 未结 6 897
死守一世寂寞
死守一世寂寞 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:41

    Don't try to run unittest.main() from IDLE. It's trying to access sys.argv, and it's getting the args that IDLE was started with. Either run your tests in a different way from IDLE, or call unittest.main() in its own Python process.

提交回复
热议问题