-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
py.test ignores exceptions in fixtures #1480
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
py.test does fail tests if a fixture raises an exception, as expected:
(Tried this in both Python 2.7 and Python 3.5) Which python and pytest versions are you using? |
I'm using Python 2.7 with pytest 2.6.4. |
2.6.4 is quite old... if this was a bug it was fixed already. 😁 |
(Please try upgrading pytest and reopen this if you still see the issue) |
Worryingly, I'm seeing this on pytest 2.9.1 as well. I'll see if it's plugin related. |
please provide full output then, are you perhaps using pytest-sugar? |
Hmm, seems to be the "flaky" plugin. Uninstalling that makes the exception appear as expected.
|
OK, thanks for narrowing the problem down. Could you please post an issue on their tracker? |
OK, seems to be fixed in flaky 3.1.1. Sorry for the noise. |
No problem! |
pytest seems to silently ignore any exception inside fixtures.
Running this with
py.test exception.py -s
gives:I would expect py.test to at least warn me that my fixture threw an error.
The text was updated successfully, but these errors were encountered: