summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-04 19:03:13 +0200
committerGitHub <noreply@github.com>2019-06-04 19:03:13 +0200
commitbc6469f79ca13217b784fb47da7ec83484a3debe (patch)
treeb39ddd93a75009b095258d3ccd8eacdfbf23009c /Lib/test
parent8d0ef0b5edeae52960c7ed05ae8a12388324f87e (diff)
downloadcpython-git-bc6469f79ca13217b784fb47da7ec83484a3debe.tar.gz
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.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_venv.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 278c68699d..24d3a69b18 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -325,8 +325,10 @@ class BasicTest(BaseTest):
envpy = os.path.join(os.path.realpath(self.env_dir),
self.bindir, self.exe)
out, err = check_output([envpy, '-c',
- 'from multiprocessing import Pool; ' +
- 'print(Pool(1).apply_async("Python".lower).get(3))'])
+ 'from multiprocessing import Pool; '
+ 'pool = Pool(1); '
+ 'print(pool.apply_async("Python".lower).get(3)); '
+ 'pool.terminate()'])
self.assertEqual(out.strip(), "python".encode())
@requireVenvCreate