0
我想有,當我執行使用os.system,我得到了相同的輸出:ValueError異常使用nosetest子
os.system('nosetests TestStateMachine.py:FluidityTest.test_it_has_an_initial_state -v')
test_it_has_an_initial_state (TestStateMachine.FluidityTest) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.001s
OK
Out[5]: 0
但是,當我執行:
x = subprocess.Popen(["nosetests",
"TestStateMachine.py:FluidityTest.test_it_has_an_initial_state -v"],
stdout=subprocess.PIPE)
我m得到:
E
======================================================================
ERROR: Failure: ValueError (No such test FluidityTest.test_it_has_an_initial_state -v)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/failure.py", line 41, in runTest
raise self.exc_class(self.exc_val)
ValueError: No such test FluidityTest.test_it_has_an_initial_state -v
----------------------------------------------------------------------
Ran 1 test in 0.034s
FAILED (errors=1)