mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
GH-83658: make multiprocessing.Pool raise an exception if maxtasksperchild is not None or a positive int (GH-93364)
Closes #83658.
This commit is contained in:
parent
38af903506
commit
e37a158725
3 changed files with 9 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue