Skip to content

Commit

Permalink
Simpler definition of input_ in tests of generator coroutines (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
dycw authored Sep 12, 2024
1 parent bbb9828 commit 255c1f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/tests/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ async def test_main(self, *, capsys: CaptureFixture) -> None:
async def func() -> AsyncGenerator[int | None, float | None]:
print("Initial") # noqa: T201
while True:
input_ = yield
output = round(ensure_not_none(input_))
input_ = ensure_not_none((yield))
output = round(input_)
if output >= 0:
print(f"Received {input_}, yielding {output}") # noqa: T201
yield output
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_main(self, *, capsys: CaptureFixture) -> None:
def func() -> Generator[int | None, float | None, str]:
print("Initial") # noqa: T201
while True:
input_ = yield
input_ = ensure_not_none((yield))
output = round(ensure_not_none(input_))
if output >= 0:
print(f"Received {input_}, yielding {output}") # noqa: T201
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

__version__ = "0.54.0"
__version__ = "0.54.1"

0 comments on commit 255c1f9

Please sign in to comment.