You are using the wrong command line. Here's the correct one:
x = subprocess.Popen(["nosetests",
"TestStateMachine.py:FluidityTest.test_it_has_an_initial_state",
"-v"],
stdout=subprocess.PIPE)
The list you pass to Popen
already represents the parsed command line. By putting the test name and the -v
in the same string it's like if you quoted them, like doing:
$nosetests "TestStateMachine.py:FluidityTest.test_it_has_an_initial_state -v"
On the command line, and the -v
ends up in the name of the test (read carefully the error you got...)