diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-06-17 22:32:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 22:32:15 (GMT) |
commit | 2d33d217aaf68fd8dc5d3eebc048baf82924c18a (patch) | |
tree | 249ba6459ce11fb58df56de9c3e658dbc098b7ae /Lib/test/_test_multiprocessing.py | |
parent | 5e30ba157705fa2ac25ecb4aef3c8073598999dd (diff) | |
download | cpython-2d33d217aaf68fd8dc5d3eebc048baf82924c18a.zip cpython-2d33d217aaf68fd8dc5d3eebc048baf82924c18a.tar.gz cpython-2d33d217aaf68fd8dc5d3eebc048baf82924c18a.tar.bz2 |
GH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int (GH-93364) (GH-93924)
Closes GH-83658.
(cherry picked from commit e37a158725dec561f234b81864363d55f05c7b4e)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 1b55cb3..ba488b1 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -2805,6 +2805,11 @@ class _TestPoolWorkerLifetime(BaseTestCase): for (j, res) in enumerate(results): self.assertEqual(res.get(), sqr(j)) + def test_pool_maxtasksperchild_invalid(self): + for value in [0, -1, 0.5, "12"]: + with self.assertRaises(ValueError): + multiprocessing.Pool(3, maxtasksperchild=value) + def test_worker_finalization_via_atexit_handler_of_multiprocessing(self): # tests cases against bpo-38744 and bpo-39360 cmd = '''if 1: |