Skip to content

TST: unpin pytest - #31906

Merged
timhoffm merged 1 commit into
matplotlib:mainfrom
rcomer:pytest-fixes
Jun 18, 2026
Merged

TST: unpin pytest#31906
timhoffm merged 1 commit into
matplotlib:mainfrom
rcomer:pytest-fixes

Conversation

@rcomer

@rcomer rcomer commented Jun 15, 2026

Copy link
Copy Markdown
Member

PR summary

Closes #31897. Turned out to not be as difficult as I thought.

  • Change the TestSpectral.stim fixture method to be a class method, following pytest's deprecation. This actually makes the code a little more intuitive as shown by the deleted comment.

  • Make lists from all the generators we use for parametrization, as that is also now deprecated.

I'm not sure why I had problems with the tests hanging when I tried yesterday, but it was fine on a different machine today 🤷‍♀️

AI Disclosure

No AI used.

PR checklist

@rcomer rcomer added the CI: testing CI configuration and testing label Jun 15, 2026
@rcomer rcomer added this to the v3.11.1 milestone Jun 15, 2026
@rcomer
rcomer marked this pull request as ready for review June 15, 2026 15:13
@QuLogic

QuLogic commented Jun 15, 2026

Copy link
Copy Markdown
Member

Can we also fix the PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated warning at the same time?

@rcomer

rcomer commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

Can we also fix the PytestRemovedIn10Warning: Passing a non-Collection iterable to parametrize is deprecated warning at the same time?

Sure, I didn’t even spot that one. I’m confused why it doesn’t show as an error when the other deprecation did.

@rcomer
rcomer marked this pull request as draft June 15, 2026 19:47
@rcomer
rcomer marked this pull request as ready for review June 16, 2026 14:37

@timhoffm timhoffm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: gen_writers and generate_validator_testcases could be changed to return lists. There’s no benefit in returning generators when we have to convert to lists anyway.

@rcomer

rcomer commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Optional: gen_writers and generate_validator_testcases could be changed to return lists. There’s no benefit in returning generators when we have to convert to lists anyway.

I thought about that but, since they are a bit complicated with multiple yields, I thought they look cleaner as-is than if the yields were replaced with appends. generate_validator_testcases could be done with a nested list comprehension in each branch of the if-loop, but I am not sure that would help readability.

I may be missing a neater way to do it.

@timhoffm

Copy link
Copy Markdown
Member

Ok, let's not bother with generator or list.

@timhoffm
timhoffm merged commit c674bae into matplotlib:main Jun 18, 2026
37 of 41 checks passed
@rcomer
rcomer deleted the pytest-fixes branch June 18, 2026 15:33
QuLogic pushed a commit that referenced this pull request Jun 18, 2026
QuLogic added a commit that referenced this pull request Jun 18, 2026
…906-on-v3.11.x

Backport PR #31906 on branch v3.11.x (TST: unpin pytest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: testing CI configuration and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNT]: unpin pytest

3 participants