mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #21362: concurrent.futures does not validate that max_workers is proper
This commit is contained in:
parent
120e8edfb8
commit
20efceb757
4 changed files with 15 additions and 0 deletions
|
|
@ -425,6 +425,13 @@ class ExecutorTest:
|
|||
self.assertTrue(collected,
|
||||
"Stale reference not collected within timeout.")
|
||||
|
||||
def test_max_workers_negative(self):
|
||||
for number in (0, -1):
|
||||
with self.assertRaisesRegexp(ValueError,
|
||||
"max_workers must be greater "
|
||||
"than 0"):
|
||||
self.executor_type(max_workers=number)
|
||||
|
||||
|
||||
class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, unittest.TestCase):
|
||||
def test_map_submits_without_iteration(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue