Skip to content

Commit f8ba1bc

Browse files
test initial=None
1 parent 3daa505 commit f8ba1bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

unittests/test_itertools.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ async def test_accumulate_misuse():
5959
assert await a.list(a.accumulate([]))
6060

6161

62+
@sync
63+
async def test_accumulate_initial():
64+
"""Test the `initial` argument to accumulate"""
65+
assert (
66+
await a.list(a.accumulate(asyncify([1, 2, 3]), initial=None))
67+
== await a.list(a.accumulate(asyncify([1, 2, 3])))
68+
== list(itertools.accumulate([1, 2, 3], initial=None))
69+
)
70+
71+
6272
batched_cases = [
6373
(range(10), 2, [(0, 1), (2, 3), (4, 5), (6, 7), (8, 9)]),
6474
(range(10), 3, [(0, 1, 2), (3, 4, 5), (6, 7, 8), (9,)]),

0 commit comments

Comments
 (0)