fix some test_weakref tests to not rely on ref-counting (closes #22267)

This commit is contained in:
Benjamin Peterson 2014-08-24 18:02:15 -05:00
parent 549c1972f2
commit 18bb702182
1 changed files with 2 additions and 0 deletions

View 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):