-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run each file containing a unit test class as subprocess #3310
Comments
It sounds like you want the pytest-forked plugin. |
Hello, The following code framework shows briefly what I want to do:
Above runs perfectly when i run python test.py, but not using pytest, or pytest --forked. Best regards |
Oops, accidentally closed, sorry. |
you can just pass each file to a new py.test call if thats your issue, |
Hello Ronny,
Unfortunately not. On a buildserver, i just want want to run pytest on the entire tree, that saves maintenance and lowers the chance on human errors.
I think so yes. Is it easy to write such a plugin? Best regards |
@wolfc01 potentially, it depends on the use case you plan to implement - and how detailed you need your reports |
Hello Ronny, quite simple:
Best regards |
since you want to run unittest only tests, you dont loose much of pytest |
Ronny, I Agree. Best regards, |
Hello,
Consider the following very simple example in a file named test.py:
before using pytest, i used to test the above on a build server as following
python test.py
which effectively runs the test in its own process. Then each unittest is strictly separated from other unittests, as the OS frees up all resources after the test has run.Because of several requirements which I don't want to explain here, I need to have each test as depicted above to run in it's own process, and use the process exit code for pass(0)/fail(1).
Is above possible using pytest?
Best regards,
Carl.
The text was updated successfully, but these errors were encountered: