From bc6469f79ca13217b784fb47da7ec83484a3debe Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 4 Jun 2019 19:03:13 +0200 Subject: 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. --- Lib/test/test_venv.py | 6 ++++-- Misc/NEWS.d/next/Tests/2019-06-04-18-30-39.bpo-37153.711INB.rst | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2019-06-04-18-30-39.bpo-37153.711INB.rst diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index 278c686..24d3a69 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 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 0000000..138a22f --- /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. -- cgit v0.12