Don't use asyncio.timeout

This commit is contained in:
Michael Hansen
2024-01-09 16:25:34 -06:00
parent b164bafc9f
commit 350eee6cb2
+2 -4
View File
@@ -92,8 +92,7 @@ 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()
await asyncio.wait_for(event_client.wake_event.wait(), timeout=1)
event_client.wake_event.clear()
# Stop streaming
@@ -101,8 +100,7 @@ async def test_multiple_wakeups(tmp_path: Path) -> None:
# 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