Skip to content

Commit 2621b88

Browse files
committed
add ft test for accumulate
1 parent e77b639 commit 2621b88

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Lib/test/test_free_threading/test_itertools.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from itertools import batched, chain, combinations_with_replacement, cycle, permutations
2+
from itertools import accumulate, batched, chain, combinations_with_replacement, cycle, permutations
33
from test.support import threading_helper
44

55

@@ -16,6 +16,13 @@ def work_iterator(it):
1616

1717
class ItertoolsThreading(unittest.TestCase):
1818

19+
@threading_helper.reap_threads
20+
def test_accumulate(self):
21+
number_of_iterations = 10
22+
for _ in range(number_of_iterations):
23+
it = accumulate(tuple(range(500)))
24+
threading_helper.run_concurrently(work_iterator, nthreads=10, args=[it])
25+
1926
@threading_helper.reap_threads
2027
def test_batched(self):
2128
number_of_iterations = 10

0 commit comments

Comments
 (0)