Skip to content
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

Merged
merged 4 commits into from
Jan 17, 2024
Merged

Prepare for Pytest v8 #27624

merged 4 commits into from
Jan 17, 2024

Conversation

ksunden
Copy link
Member

@ksunden ksunden commented Jan 10, 2024

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 of with 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

The behavior of pytest.warns has changed, particularly with regards to handling of additional warnings
@dstansby
Copy link
Member

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?

@ksunden
Copy link
Member Author

ksunden commented Jan 11, 2024

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 pip install -U --pre pytest to test locally. I think the scheduled prerelease ci run may catch it, but I don't think we have that set up to run on PR via a label like we do for some other CI runs.

@ksunden
Copy link
Member Author

ksunden commented Jan 11, 2024

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>
@tacaswell tacaswell added this to the v3.8.3 milestone Jan 16, 2024
@QuLogic QuLogic merged commit ed41aea into matplotlib:main Jan 17, 2024
39 of 42 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jan 17, 2024
rcomer added a commit that referenced this pull request Jan 17, 2024
…624-on-v3.8.x

Backport PR #27624 on branch v3.8.x (Prepare for Pytest v8)
@ksunden ksunden mentioned this pull request Feb 14, 2024
1 task
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Feb 15, 2024
Prepare for Pytest v8

(cherry picked from commit ed41aea)
@QuLogic QuLogic modified the milestones: v3.8.3, v3.7.5 Feb 15, 2024
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Feb 15, 2024
Prepare for Pytest v8

(cherry picked from commit ed41aea)

Co-authored-by: Kyle Sunden <git@ksunden.space>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants