Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
How to correctly run pytest.main() programmatically multiple times? #3143
If I invoke
But then what is the correct way to rerun pytest programmatically? Could you point me to an example? Starting it in a subprocess feels quite clunky and also makes it more cumbersome to process the results.
(Also, could we possibly have a note about that behavior in the docs? At least to me, it was somewhat unexpected that I can't run
python modules cache in side the same process and due to this property of python its not advisable to run pytest.main twice from the same process
while there may be exceptions to that rule, in general its more safe to run a new process since python is not safe for code reloading