TST: Make refcount tests more resilient to Python changes#29970
Merged
tacaswell merged 1 commit intomatplotlib:mainfrom Apr 28, 2025
Merged
TST: Make refcount tests more resilient to Python changes#29970tacaswell merged 1 commit intomatplotlib:mainfrom
tacaswell merged 1 commit intomatplotlib:mainfrom
Conversation
Check the change of the refcount, instead of the absolute value, as suggested by @ngoldbaum.
timhoffm
approved these changes
Apr 26, 2025
oscargus
reviewed
Apr 26, 2025
| orig_refcount = sys.getrefcount(qk) | ||
| qk.remove() | ||
| assert sys.getrefcount(qk) == 2 | ||
| assert sys.getrefcount(qk) < orig_refcount |
Member
There was a problem hiding this comment.
Suggested change
| assert sys.getrefcount(qk) < orig_refcount | |
| assert sys.getrefcount(qk) == orig_refcount - 1 |
? If not, feel free to self merge.
oscargus
approved these changes
Apr 26, 2025
Member
|
Testing this I also found pandas-dev/pandas#61368 |
Member
|
Merging this on top of #29393 the two reference count tests pass again (I also see a pandas failure, a webagg failure, and all the sphinx tests fail (but those look like installation / build issues from some c-extension caused by wheels), a tz test that is a dependency installation issue, and something with pgf that I have not investigated yet). |
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Apr 28, 2025
… to Python changes
dstansby
added a commit
that referenced
this pull request
Apr 28, 2025
…970-on-v3.10.x Backport PR #29970 on branch v3.10.x (TST: Make refcount tests more resilient to Python changes)
|
Matplotlib builds successfully with Python 3.14.0b1 in Fedora. Thank you! |
Member
|
@befeleme Are you also carrying the deepcopy patch? |
|
Yes |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
Check the change of the refcount, instead of the absolute value, as suggested by @ngoldbaum in #29959 (comment).
I did not test against Python 3.14, but perhaps @befeleme could.
PR checklist