From 350eee6cb2e8281176eba016758bc5882cae0ade Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Tue, 9 Jan 2024 16:25:34 -0600 Subject: [PATCH] Don't use asyncio.timeout --- tests/test_wake_streaming.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_wake_streaming.py b/tests/test_wake_streaming.py index c2c6077..bd417d9 100644 --- a/tests/test_wake_streaming.py +++ b/tests/test_wake_streaming.py @@ -92,17 +92,15 @@ async def test_multiple_wakeups(tmp_path: Path) -> None: satellite_task = asyncio.create_task(satellite.run(), name="satellite") await satellite.event_from_server(RunSatellite().event()) - async with asyncio.timeout(1): - await event_client.wake_event.wait() - event_client.wake_event.clear() + await asyncio.wait_for(event_client.wake_event.wait(), timeout=1) + event_client.wake_event.clear() # Stop streaming await satellite.event_from_server(Transcript("test").event()) # Should not trigger again within refractory period (default: 5 sec) with pytest.raises(asyncio.TimeoutError): - async with asyncio.timeout(0.15): - await event_client.wake_event.wait() + await asyncio.wait_for(event_client.wake_event.wait(), timeout=0.15) await satellite.stop() await satellite_task