]> granicus.if.org Git - python/commitdiff
add gc_collects to weakref tests
authorPhilip Jenvey <pjenvey@underboss.org>
Tue, 13 Nov 2012 20:26:31 +0000 (12:26 -0800)
committerPhilip Jenvey <pjenvey@underboss.org>
Tue, 13 Nov 2012 20:26:31 +0000 (12:26 -0800)
Lib/test/test_exceptions.py

index 7a2dd0c8f17fa86d0c6a0c366a142c4938cb66f3..3c14c80481eb677bbff4f6cc662648b355038116 100644 (file)
@@ -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)