summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-06-17 07:14:26 (GMT)
committerGitHub <noreply@github.com>2022-06-17 07:14:26 (GMT)
commite37a158725dec561f234b81864363d55f05c7b4e (patch)
tree085cbe4c637ea536bfc9385f699b2560ca8f6ed3 /Lib/test/_test_multiprocessing.py
parent38af903506e9b18c6350c1dadcb489f057713f36 (diff)
downloadcpython-e37a158725dec561f234b81864363d55f05c7b4e.zip
cpython-e37a158725dec561f234b81864363d55f05c7b4e.tar.gz
cpython-e37a158725dec561f234b81864363d55f05c7b4e.tar.bz2
GH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int (GH-93364)
Closes #83658.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index b20bc0b..7596997 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -2863,6 +2863,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: