-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Prepare for Pytest v8 #27624
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
Prepare for Pytest v8 #27624
Conversation
The behavior of pytest.warns has changed, particularly with regards to handling of additional warnings
Is any the CI for this PR running with pytest 8 to check that these fixes do indeed work? Or should I install pytest 8 locally to check? |
Looks like I need to figure out a way of fixing one particular test so that it works in both pytest 7 and 8... I did indeed just install |
Yeah, that particular test raises 2 separate warnings on the same line of code, pytest 7 swallows the outer one and so you get "did not warn", pytest 8 passes it through, so if you don't have both it gets raised... I think I just need to filter the deprecation warning here as it is already tested earlier in the test. |
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
…624-on-v3.8.x Backport PR #27624 on branch v3.8.x (Prepare for Pytest v8)
Prepare for Pytest v8 (cherry picked from commit ed41aea)
Prepare for Pytest v8 (cherry picked from commit ed41aea) Co-authored-by: Kyle Sunden <git@ksunden.space>
PR summary
The behavior of pytest.warns has changed, particularly with regards to handling of additional warnings
When additional warnings that were not tested for are raised, I simply add a
filterwarnings
(some are artifacts ofwith
blocks).And there are a couple that seem are not actually currently warning at all, but had been occluded by a
pytest.errors
.PR checklist