Skip to content

Commit bc6469f

Browse files
authored
bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (GH-13816)
test_venv.test_mutiprocessing() now explicitly calls pool.terminate() to wait until the pool completes.
1 parent 8d0ef0b commit bc6469f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Lib/test/test_venv.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,10 @@ def test_multiprocessing(self):
325325
envpy = os.path.join(os.path.realpath(self.env_dir),
326326
self.bindir, self.exe)
327327
out, err = check_output([envpy, '-c',
328-
'from multiprocessing import Pool; ' +
329-
'print(Pool(1).apply_async("Python".lower).get(3))'])
328+
'from multiprocessing import Pool; '
329+
'pool = Pool(1); '
330+
'print(pool.apply_async("Python".lower).get(3)); '
331+
'pool.terminate()'])
330332
self.assertEqual(out.strip(), "python".encode())
331333

332334
@requireVenvCreate
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
``test_venv.test_mutiprocessing()`` now explicitly calls
2+
``pool.terminate()`` to wait until the pool completes.

0 commit comments

Comments
 (0)