今天我写了一个测试,无论如何我都无法通过测试。
然后我发现我得到 SystemExit: False 即使没有任何测试用例:
>>> ================================ RESTART ================================
>>> import unittest
>>> unittest.main()
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
Traceback (most recent call last):
File "<pyshell#123>", line 1, in <module>
unittest.main()
File "C:\Python27x64\Lib\unittest\main.py", line 95, in __init__
self.runTests()
File "C:\Python27x64\Lib\unittest\main.py", line 231, in runTests
sys.exit(not self.result.wasSuccessful())
SystemExit: False
这种行为正常吗?还:
>>> class aTest(unittest.TestCase):
def test_123(self):
self.assertEqual(2, 1+1)
>>> unittest.main()
.
----------------------------------------------------------------------
Ran 1 test in 0.011s
OK
Traceback (most recent call last):
File "<pyshell#133>", line 1, in <module>
unittest.main()
File "C:\Python27x64\Lib\unittest\main.py", line 95, in __init__
self.runTests()
File "C:\Python27x64\Lib\unittest\main.py", line 231, in runTests
sys.exit(not self.result.wasSuccessful())
SystemExit: False