Skip to content

TST: Make refcount tests more resilient to Python changes #29970

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

Merged
merged 1 commit into from
Apr 28, 2025

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Apr 26, 2025

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

Check the change of the refcount, instead of the absolute value, as
suggested by @ngoldbaum.
@QuLogic QuLogic added this to the v3.10.2 milestone Apr 26, 2025
qk.remove()
assert sys.getrefcount(qk) == 2
assert sys.getrefcount(qk) < orig_refcount
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert sys.getrefcount(qk) < orig_refcount
assert sys.getrefcount(qk) == orig_refcount - 1

? If not, feel free to self merge.

@tacaswell
Copy link
Member

Testing this I also found pandas-dev/pandas#61368

@tacaswell
Copy link
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).

@tacaswell tacaswell merged commit 828ec6f into matplotlib:main Apr 28, 2025
41 of 43 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 28, 2025
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)
@QuLogic QuLogic deleted the test-quiver-refcount branch April 29, 2025 05:10
@ksunden ksunden mentioned this pull request May 9, 2025
5 tasks
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.

4 participants