I'm running a large suite of python tests using pytest, and some test results depend on the running order of the tests. For example if test B runs after test A then it can fail due to some initializations done in test A that affect test B.
To circumvent this problem I would like to run each test in a new process, but the tests should still run sequentially and not in parallel.
Is there a way to do that with pytest?
I would recommend that you implement setup_method() and teardown_method() that can cleanup initializations you do in the tests. This way you can get rid of dependencies you have with the order of execution of your tests.
The other alternative would be to use a fixture. 
But if you dont want to run the tests in parallel, I dont see the advantage of starting each test in a new process. Although if you still need it, you can start a new process in your setup_method() and attach the current test to this process. Your teardown_method() can then kill this process.
pytest - run each test in a separate process