-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
pytest.warns(None) is no longer supported #6679
Comments
From the pytest's changelog:
|
And this is the code we are talking about: requests/tests/test_requests.py Lines 1006 to 1008 in 2a438c2
|
In our testing environment with pytest 8.1.1 and urllib3 < 2.0 removing the None from |
`pytest.warns(None)` has been deprecated in pytest 7.0.0 and it's no longer working in pytest 8. Resolves: psf#6679
`pytest.warns(None)` has been deprecated in pytest 7.0.0 and it's no longer working in pytest 8. Resolves: psf#6679
I'm not sure why the last comment by @kloczek has been removed but PR with the simple fix is ready. |
Not sure what was this code supposed to mean (making sure that there are no warnings? I don't think it ever did that?), but on pytest 8 it no longer works: "TypeError: exceptions must be derived from Warning, not <class 'NoneType'>"
https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests
The text was updated successfully, but these errors were encountered: