summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2019-01-25 22:59:12 (GMT)
committerGitHub <noreply@github.com>2019-01-25 22:59:12 (GMT)
commit4e02f8f8b4baab63f927cfd87b401200ba2969e9 (patch)
treef3a946b168fc3c72b7b6afda4a164b2d008e096b /Lib/test/test_venv.py
parent3bab40db96efda2e127ef84e6501fda0cdc4f5b8 (diff)
downloadcpython-4e02f8f8b4baab63f927cfd87b401200ba2969e9.zip
cpython-4e02f8f8b4baab63f927cfd87b401200ba2969e9.tar.gz
cpython-4e02f8f8b4baab63f927cfd87b401200ba2969e9.tar.bz2
bpo-35797: Fix default executable used by the multiprocessing module (GH-11676)
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r--Lib/test/test_venv.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 22a3b78..34c2234 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -306,6 +306,19 @@ class BasicTest(BaseTest):
)
self.assertEqual(out.strip(), '0')
+ def test_multiprocessing(self):
+ """
+ Test that the multiprocessing is able to spawn.
+ """
+ rmtree(self.env_dir)
+ self.run_with_capture(venv.create, self.env_dir)
+ 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))'])
+ self.assertEqual(out.strip(), "python".encode())
+
@skipInVenv
class EnsurePipTest(BaseTest):
"""Test venv module installation of pip."""