Skip to content

Commit 802ea80

Browse files
authored
Update test_iter.py
1 parent 3a448c4 commit 802ea80

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_iter.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
from pydu.iter import first, last, all, any, join
33

44

5-
@pytest.mark.parametrize(
6-
'iterable', (
7-
[1, 2],
8-
(1, 2),
9-
{1, 2},
10-
{1: 1, 2: 2},
11-
iter([1, 2])
12-
))
135
def first(iterable):
146
return next(iter(iterable)) if hasattr(iterable, '__iter__') else iterable
157

@@ -18,6 +10,14 @@ def last(iterable):
1810
return list(iterable)[-1]
1911

2012

13+
@pytest.mark.parametrize(
14+
'iterable', (
15+
[1, 2],
16+
(1, 2),
17+
{1, 2},
18+
{1: 1, 2: 2},
19+
iter([1, 2]) # This is the iterator causing exhaustion
20+
))
2121
def test_first_last(iterable):
2222
if isinstance(iterable, (list, tuple, set, dict)):
2323
assert first(iterable) == 1

0 commit comments

Comments
 (0)