summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-08-24 23:02:15 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-08-24 23:02:15 (GMT)
commit8a4448c8bb5aabbe3b4d167ba568687d197aaa1a (patch)
tree2939bca4fead5dd72444ea5e2a5c8c5a1abd2cb5 /Lib
parente37375405657413ef9b83b935bb4ed17cd745ce6 (diff)
downloadcpython-8a4448c8bb5aabbe3b4d167ba568687d197aaa1a.zip
cpython-8a4448c8bb5aabbe3b4d167ba568687d197aaa1a.tar.gz
cpython-8a4448c8bb5aabbe3b4d167ba568687d197aaa1a.tar.bz2
fix some test_weakref tests to not rely on ref-counting (closes #22267)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_weakref.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 40e1473..cc0a755 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -1154,6 +1154,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):
@@ -1175,6 +1176,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):