summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-08-15 14:53:25 (GMT)
committerGitHub <noreply@github.com>2023-08-15 14:53:25 (GMT)
commitdb4400b5b28dc17c9eac47780402c0b812703358 (patch)
treec3bc6b2ac6e1b3eb5117ae375c252069ea37866a /Lib/test/_test_multiprocessing.py
parente2420c5cae7a173c5242b3507979010a933e53a7 (diff)
downloadcpython-db4400b5b28dc17c9eac47780402c0b812703358.zip
cpython-db4400b5b28dc17c9eac47780402c0b812703358.tar.gz
cpython-db4400b5b28dc17c9eac47780402c0b812703358.tar.bz2
[3.11] gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965) (gh-107976)
gh-107963: Fix set_forkserver_preload to check the type of given list (GH-107965) (cherry picked from commit 6515ec3d3d5acd3d0b99c88794bdec09f0831e5b) gh-107963: Fix set_forkserver_preload to check the type of given list Co-authored-by: Dong-hee Na <donghee.na@python.org>
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index aa302c2..29dc386 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -5293,6 +5293,14 @@ class TestStartMethod(unittest.TestCase):
self.assertRaises(ValueError, ctx.set_start_method, None)
self.check_context(ctx)
+ def test_context_check_module_types(self):
+ try:
+ ctx = multiprocessing.get_context('forkserver')
+ except ValueError:
+ raise unittest.SkipTest('forkserver should be available')
+ with self.assertRaisesRegex(TypeError, 'module_names must be a list of strings'):
+ ctx.set_forkserver_preload([1, 2, 3])
+
def test_set_get(self):
multiprocessing.set_forkserver_preload(PRELOAD)
count = 0