Skip to content

Commit 7ef8b42

Browse files
committed
Fixed test coverage
1 parent 5dbe56c commit 7ef8b42

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python -V
2929
pip freeze
3030
- name: ruff
31-
run: ruff check
31+
run: ruff check --output-format=github
3232
- name: pytest
3333
run: py.test
3434

@@ -49,7 +49,7 @@ jobs:
4949
run: make html
5050
working-directory: docs/
5151
- name: ruff
52-
run: ruff check
52+
run: ruff check --output-format=github
5353
- name: mypy
5454
run: mypy python_utils setup.py
5555
- name: pyright

_python_utils_tests/test_aio.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,11 @@ async def async_gen():
5858
yield 3, 4
5959
yield 5, 6
6060

61+
async def empty_gen():
62+
if False:
63+
yield 1, 2
64+
6165
assert await adict(async_gen) == {1: 2, 3: 4, 5: 6}
66+
assert await adict(async_gen()) == {1: 2, 3: 4, 5: 6}
67+
assert await adict(empty_gen) == {}
68+
assert await adict(empty_gen()) == {}

python_utils/aio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ async def adict(
109109

110110
item: types.Tuple[_K, _V]
111111
items: types.List[types.Tuple[_K, _V]] = []
112-
async for item in iterable_:
112+
async for item in iterable_: # pragma: no branch
113113
items.append(item)
114114

115115
return container(items)

python_utils/terminal.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
1111
Usage example:
1212
>>> width, height = get_terminal_size()
13-
>>> print(f"Width: {width}, Height: {height}")
1413
"""
1514
from __future__ import annotations
1615

0 commit comments

Comments
 (0)