From 60b1f489d21806f16332adc8cc89ddde846dcf87 Mon Sep 17 00:00:00 2001 From: ThatXliner Date: Tue, 19 Dec 2023 15:17:20 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20I=20guess=20the=20tests=20took=20a?= =?UTF-8?q?=20bit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_scenarios.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index 45a7a9c..e6e1c8d 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -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)