Issue #21362: concurrent.futures does not validate that max_workers is proper

This commit is contained in:
Brian Quinlan 2014-05-17 13:51:10 -07:00
parent 120e8edfb8
commit 20efceb757
4 changed files with 15 additions and 0 deletions

View file

@ -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):