Skip to content

Commit 33bcc89

Browse files
committed
test: itertools.chain stop iteration on error
1 parent 4c11720 commit 33bcc89

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

extra_tests/snippets/stdlib_itertools.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
assert next(x) == 0
5858
assert next(x) == 1
5959

60+
x = chain(1, [2])
61+
with assert_raises(TypeError):
62+
next(x)
63+
with assert_raises(StopIteration):
64+
next(x)
65+
6066
# itertools.count tests
6167

6268
# default arguments

0 commit comments

Comments
 (0)