]> granicus.if.org Git - python/commitdiff
fix some test_weakref tests to not rely on ref-counting (closes #22267)
authorBenjamin Peterson <benjamin@python.org>
Sun, 24 Aug 2014 23:02:15 +0000 (18:02 -0500)
committerBenjamin Peterson <benjamin@python.org>
Sun, 24 Aug 2014 23:02:15 +0000 (18:02 -0500)
Lib/test/test_weakref.py

index cccb5152527358d895ab3f8d5ccefac9153e6eba..0a591201dee36977b5d5353d3beb57a1fc0daed2 100644 (file)
@@ -1317,6 +1317,7 @@ class MappingTestCase(TestBase):
                 yield Object(v), v
             finally:
                 it = None           # should commit all removals
+                gc.collect()
         self.check_weak_destroy_and_mutate_while_iterating(dict, testcontext)
 
     def test_weak_values_destroy_while_iterating(self):
@@ -1339,6 +1340,7 @@ class MappingTestCase(TestBase):
                 yield k, Object(k)
             finally:
                 it = None           # should commit all removals
+                gc.collect()
         self.check_weak_destroy_and_mutate_while_iterating(dict, testcontext)
 
     def test_make_weak_keyed_dict_from_dict(self):