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>
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 ofwithblocks).And there are a couple that seem are not actually currently warning at all, but had been occluded by a
pytest.errors.PR checklist