This commit is contained in:
Benjamin Peterson 2016-10-04 00:00:23 -07:00
commit 804480912c
3 changed files with 23 additions and 12 deletions

View file

@ -845,6 +845,14 @@ class ReferencesTestCase(TestBase):
with self.assertRaises(AttributeError):
ref1.__callback__ = lambda ref: None
def test_callback_gcs(self):
class ObjectWithDel(Object):
def __del__(self): pass
x = ObjectWithDel(1)
ref1 = weakref.ref(x, lambda ref: support.gc_collect())
del x
support.gc_collect()
class SubclassableWeakrefTestCase(TestBase):