@@ -7,6 +7,7 @@ |
|
|
7 |
7 |
|
8 |
8 |
from test.support.script_helper import assert_python_ok |
9 |
9 |
|
|
10 |
+import itertools |
10 |
11 |
import os |
11 |
12 |
import sys |
12 |
13 |
import threading |
@@ -395,8 +396,11 @@ def test_zero_timeout(self): |
|
|
395 |
396 |
def test_duplicate_futures(self): |
396 |
397 |
# Issue 20367. Duplicate futures should not raise exceptions or give |
397 |
398 |
# duplicate responses. |
|
399 |
+# Issue #31641: accept arbitrary iterables. |
398 |
400 |
future1 = self.executor.submit(time.sleep, 2) |
399 |
|
-completed = [f for f in futures.as_completed([future1,future1])] |
|
401 |
+completed = [ |
|
402 |
+f for f in futures.as_completed(itertools.repeat(future1, 3)) |
|
403 |
+ ] |
400 |
404 |
self.assertEqual(len(completed), 1) |
401 |
405 |
|
402 |
406 |
def test_free_reference_yielded_future(self): |