Skip to content

Commit

Permalink
bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (py…
Browse files Browse the repository at this point in the history
…thonGH-13816)

test_venv.test_mutiprocessing() now explicitly calls pool.terminate()
to wait until the pool completes.
(cherry picked from commit bc6469f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
  • Loading branch information
vstinner authored and miss-islington committed Jun 4, 2019
1 parent 250b62a commit 9236f83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/test/test_venv.py
Expand Up @@ -312,8 +312,10 @@ def test_multiprocessing(self):
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
Expand Down
@@ -0,0 +1,2 @@
``test_venv.test_mutiprocessing()`` now explicitly calls
``pool.terminate()`` to wait until the pool completes.

0 comments on commit 9236f83

Please sign in to comment.