-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Establish best practices for errors on warnings - of which some get ignored #3800
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
@nicoddemus its unrelated - the problem here is that i did set a global error on all - but the resoruce warning happens in a place where the exception is ignored by the stdlib, so i missed the problem since i expected a hard failure, instead i got an "exception ignored" |
I see, thanks. I think we might catch that once #3251 lands, but more investigation would be needed. |
Hmmm... this isn't about a deprecation warning, is it? |
@SnarkBoojum no, its about a RessourceWarning triggering in a place where python does a catchall to catch that pytest would need to track those exceptions as well and return a error exit state |
The error is written to stderr when Python cannot handle an exception (in Here is a minimal reproducer: test_resleak.py: def test_resleak():
f = open(__file__) Output of
|
I think by that point we are already outside |
I'm closing this for now: the exceptions/warnings mentioned here happen after pytest.main() has exited, so I don't see how we can implement this (if somebody does, please feel free to reopen with a suggestion). 👍 |
follow-up to pypa/setuptools-scm#305
it i blatantly missed an ignored exception from a resource warning due to green test results while setting an error for all warnings
pytest should either establish a well known best practice for configuring that, or go yellow on those errors that get ignored by the stdlib for a good reason
The text was updated successfully, but these errors were encountered: