aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 4c4da24a30c..7e0b7571097 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -611,6 +611,7 @@ class _TestProcess(BaseTestCase):
del c
p.start()
p.join()
+ gc.collect() # For PyPy or other GCs.
self.assertIs(wr(), None)
self.assertEqual(q.get(), 5)
close_queue(q)
@@ -2667,6 +2668,7 @@ class _TestPool(BaseTestCase):
self.pool.map(identity, objs)
del objs
+ gc.collect() # For PyPy or other GCs.
time.sleep(DELTA) # let threaded cleanup code run
self.assertEqual(set(wr() for wr in refs), {None})
# With a process pool, copies of the objects are returned, check
@@ -4198,6 +4200,7 @@ class _TestFinalize(BaseTestCase):
util._finalizer_registry.clear()
def tearDown(self):
+ gc.collect() # For PyPy or other GCs.
self.assertFalse(util._finalizer_registry)
util._finalizer_registry.update(self.registry_backup)
@@ -4209,12 +4212,14 @@ class _TestFinalize(BaseTestCase):
a = Foo()
util.Finalize(a, conn.send, args=('a',))
del a # triggers callback for a
+ gc.collect() # For PyPy or other GCs.
b = Foo()
close_b = util.Finalize(b, conn.send, args=('b',))
close_b() # triggers callback for b
close_b() # does nothing because callback has already been called
del b # does nothing because callback has already been called
+ gc.collect() # For PyPy or other GCs.
c = Foo()
util.Finalize(c, conn.send, args=('c',))