8000 gh-135552: Add tests that check if weakref for tp_subclasses cleared after finalization by sergey-miryanov · Pull Request #136304 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-135552: Add tests that check if weakref for tp_subclasses cleared after finalization #136304

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Use unittest asserts
  • Loading branch information
sergey-miryanov committed Jul 6, 2025
commit 50410d6b90ec8fd4a957678ada48431b648b1a22
6 changes: 3 additions & 3 deletions Lib/test/test_gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,9 +1186,9 @@ def __del__(self):
test()
"""
_, stdout, _ = assert_python_ok("-c", code)
assert b"Type weakref with callback is None as expected" in stdout
assert b"Type weakref is Class as expected" in stdout
assert b"Instance weakref is None as expected" in stdout
self.assertRegex(stdout, b"Type weakref with callback is None as expected")
self.assertRegex(stdout, b"Type weakref is Class as expected")
self.assertRegex(stdout, b"Instance weakref is None as expected")


class IncrementalGCTests(unittest.TestCase):
Expand Down
Loading
0