Skip to content

Commit

Permalink
✅ I guess the tests took a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatXliner committed Dec 19, 2023
1 parent 544e333 commit 60b1f48
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/test_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,20 @@ async def no_server(connection: aioudp.Connection) -> None:
# XXX: Binary search for optimal timeout


@given(data=st.binary())
@pytest.mark.asyncio
async def test_bad_server(data: bytes):
assume(data)
async def test_bad_server():
async with aioudp.serve(host="localhost", port=9999, handler=bad_server):
async with aioudp.connect("localhost", 9999) as connection:
await connection.send(data)
await connection.send(b"Hello world")
with pytest.raises(asyncio.TimeoutError):
await asyncio.wait_for(connection.recv(), timeout=1)


@given(data=st.binary())
@pytest.mark.asyncio
async def test_no_send_data(data: bytes):
assume(data)
async def test_no_send_data():
async with aioudp.serve(host="localhost", port=9999, handler=no_server):
async with aioudp.connect("localhost", 9999) as connection:
await connection.send(data)
await connection.send(b"Hello world")
with pytest.raises(asyncio.TimeoutError):
await asyncio.wait_for(connection.recv(), timeout=1)

Expand Down

0 comments on commit 60b1f48

Please sign in to comment.