diff options
| author | Dong-hee Na <donghee.na@python.org> | 2023-08-15 13:58:12 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-15 13:58:12 (GMT) |
| commit | 6515ec3d3d5acd3d0b99c88794bdec09f0831e5b (patch) | |
| tree | 8fb756fdfeafbbc5cbbb388ff17dd86a6adcf3f4 /Lib/test/_test_multiprocessing.py | |
| parent | d66bc9e8a7a8d6774d912a4b9d151885c4d8de1d (diff) | |
| download | cpython-6515ec3d3d5acd3d0b99c88794bdec09f0831e5b.zip cpython-6515ec3d3d5acd3d0b99c88794bdec09f0831e5b.tar.gz cpython-6515ec3d3d5acd3d0b99c88794bdec09f0831e5b.tar.bz2 | |
gh-107963: Fix set_forkserver_preload to check the type of given list (#107965)
gh-107963: Fix set_forkserver_preload to check the type of given list
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
| -rw-r--r-- | Lib/test/_test_multiprocessing.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index f881a5d..1075496 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5369,6 +5369,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 |
