Skip to content

Commit ed6f27d

Browse files
committed
For some reason the coverage fails, but only on Python 3.9...
1 parent 26b4680 commit ed6f27d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

_python_utils_tests/test_aio.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ async def async_gen():
3030
yield 2
3131
yield 3
3232

33+
async def empty_gen():
34+
if False:
35+
yield 1
36+
3337
assert await acontainer(async_gen) == [1, 2, 3]
3438
assert await acontainer(async_gen()) == [1, 2, 3]
3539
assert await acontainer(async_gen, set) == {1, 2, 3}
3640
assert await acontainer(async_gen(), set) == {1, 2, 3}
41+
assert await acontainer(empty_gen) == []
42+
assert await acontainer(empty_gen()) == []

python_utils/aio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def acontainer(
4848

4949
item: _T
5050
items: types.List[_T] = []
51-
async for item in iterable_:
51+
async for item in iterable_: # pragma: no branch
5252
items.append(item)
5353

5454
return container(items)

0 commit comments

Comments
 (0)