Issue #11777: Executor.map does not submit futures until iter.next() is called

This commit is contained in:
Brian Quinlan 2011-04-08 08:19:33 +10:00
parent 0df80926c9
commit f007876bd6
2 changed files with 22 additions and 10 deletions

View file

@ -369,7 +369,15 @@ class ExecutorTest(unittest.TestCase):
class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest):
pass
def test_map_submits_without_iteration(self):
"""Tests verifying issue 11777."""
finished = []
def record_finished(n):
finished.append(n)
self.executor.map(record_finished, range(10))
self.executor.shutdown(wait=True)
self.assertCountEqual(finished, range(10))
class ProcessPoolExecutorTest(ProcessPoolMixin, ExecutorTest):