[Python-checkins] bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (GH-13816)

Victor Stinner webhook-mailer at python.org
Tue Jun 4 13:03:17 EDT 2019


https://github.com/python/cpython/commit/bc6469f79ca13217b784fb47da7ec83484a3debe
commit: bc6469f79ca13217b784fb47da7ec83484a3debe
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-06-04T19:03:13+02:00
summary:

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.

files:
A Misc/NEWS.d/next/Tests/2019-06-04-18-30-39.bpo-37153.711INB.rst
M Lib/test/test_venv.py

diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 278c68699d8e..24d3a69b1878 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -325,8 +325,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
diff --git a/Misc/NEWS.d/next/Tests/2019-06-04-18-30-39.bpo-37153.711INB.rst b/Misc/NEWS.d/next/Tests/2019-06-04-18-30-39.bpo-37153.711INB.rst
new file mode 100644
index 000000000000..138a22f6acc2
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-06-04-18-30-39.bpo-37153.711INB.rst
@@ -0,0 +1,2 @@
+``test_venv.test_mutiprocessing()`` now explicitly calls
+``pool.terminate()`` to wait until the pool completes.



More information about the Python-checkins mailing list