From 3acc7ef1c5f9eb7cc4a56672ac2ee028c5522b61 Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Tue, 13 Nov 2012 12:26:31 -0800 Subject: [PATCH] add gc_collects to weakref tests --- Lib/test/test_exceptions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 7a2dd0c8f17..3c14c80481e 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -493,6 +493,7 @@ class ExceptionTests(unittest.TestCase): e.__context__ = None obj = None obj = wr() + gc_collect() self.assertTrue(obj is None, "%s" % obj) # Some complicated construct @@ -509,6 +510,7 @@ class ExceptionTests(unittest.TestCase): except MyException: pass obj = None + gc_collect() obj = wr() self.assertTrue(obj is None, "%s" % obj) @@ -523,6 +525,7 @@ class ExceptionTests(unittest.TestCase): with Context(): inner_raising_func() obj = None + gc_collect() obj = wr() self.assertTrue(obj is None, "%s" % obj)