Skip to content

Commit

Permalink
Update test_awaitable.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity authored May 1, 2024
1 parent 457cde1 commit 928b026
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_awaitable.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,26 @@ def cb(awaitable_inner: pyawaitable.Awaitable, result: int) -> int:

await awaitable
assert data == [1]

@limit_leaks("5 KB")
@pytest.mark.asyncio
async def test_await_no_cb_raise():
awaitable = abi.awaitable_new()

async def coro() -> None:
raise ZeroDivisionError("test")

abi.awaitable_await(awaitable, coro(), awaitcallback(0), awaitcallback_err(0))

with pytest.raises(ZeroDivisionError):
await awaitable

@limit_leaks("5 KB")
@pytest.mark.asyncio
async def test_await_no_cb_raise():
awaitable = abi.awaitable_new()

abi.awaitable_await(awaitable, 42, awaitcallback(0), awaitcallback_err(0))

with pytest.raises(TypeError):
await awaitable

0 comments on commit 928b026

Please sign in to comment.