Fix memory leaks in test_capi (#98017)

This commit is contained in:
Carl Meyer 2022-10-07 08:17:41 -07:00 committed by GitHub
parent f99bb20cde
commit be4099e55d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -1495,6 +1495,9 @@ class TestDictWatchers(unittest.TestCase):
unraisable = unraisables[0]
self.assertIs(unraisable.object, d)
self.assertEqual(str(unraisable.exc_value), "boom!")
# avoid leaking reference cycles
del unraisable
del unraisables
def test_two_watchers(self):
d1 = {}