summaryrefslogtreecommitdiff
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-10-04 00:00:23 -0700
committerBenjamin Peterson <benjamin@python.org>2016-10-04 00:00:23 -0700
commit804480912c8328df7d042c6e5201cfe4abf21742 (patch)
treee78e67f7de97f402c3c2b26093ba3a25230fed3c /Lib/test/test_weakref.py
parentfb12ce1cb3ded55e17833603715b1a38e15be20d (diff)
parent8f657c35b978b681e6e919f08358992e1aed7dc1 (diff)
downloadcpython-git-804480912c8328df7d042c6e5201cfe4abf21742.tar.gz
merge 3.5 (#26617)
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r--Lib/test/test_weakref.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 6e6990cd58..a474a077b7 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -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):