]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-37153: test_venv.test_mutiprocessing() calls pool.terminate() (GH-13816) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 4 Jun 2019 19:07:03 +0000 (12:07 -0700)
committerVictor Stinner <vstinner@redhat.com>
Tue, 4 Jun 2019 19:07:03 +0000 (21:07 +0200)
test_venv.test_mutiprocessing() now explicitly calls pool.terminate()
to wait until the pool completes.
(cherry picked from commit bc6469f79ca13217b784fb47da7ec83484a3debe)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Lib/test/test_venv.py
Misc/NEWS.d/next/Tests/2019-06-04-18-30-39.bpo-37153.711INB.rst [new file with mode: 0644]

index 19a5aab7a210b4ef47a774db09bbe691643fac47..a8dc59cb81c334d407d1233b8a395ac5602ff1ff 100644 (file)
@@ -312,8 +312,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
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 (file)
index 0000000..138a22f
--- /dev/null
@@ -0,0 +1,2 @@
+``test_venv.test_mutiprocessing()`` now explicitly calls
+``pool.terminate()`` to wait until the pool completes.