-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
py.test exits with code 0 on errors #913
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
Comments
How could we reproduce this? Where are the I can't reproduce this with this file: import pytest
@pytest.fixture
def fix():
raise Exception
def test_foo(fix):
pass
|
Yeah, we actually just experimented with it a bunch and it turns out it was an error with something in the shell our intern wrote -_-;
Sorry about that, I'll close the issue. |
Fwiw, it was because he added a tee to the shell command and that causes a 0 exit code every time:
|
Oh, and thanks for trying to help @The-Compiler. Sorry for the bother. |
Bash is a... fun language. No worries 😉 |
This just happened to me too and I found this issue. python -m pytest tests/
exit $? otherwise it will always be 0. |
We set up a pytest job in Jenkins to test an automatic bug logging script and we found that when py.test exits with no failures but with errors, we get an exit status of 0.
For more insight, here's the part of the bash script that shows the exit code being assigned to RESULT:
You can imagine this is pretty bad in any instance where success or failure depends on checking the exit code for pytest (like a Jenkins bash script).
The text was updated successfully, but these errors were encountered: