Skip to content

Commit

Permalink
changing to asyncio.wait_for since feature added in 3.11, don't yet h…
Browse files Browse the repository at this point in the history
…ave support for
  • Loading branch information
taddes committed Mar 20, 2024
1 parent 084b5ae commit 367ecd9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/integration/async_push_test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ async def get_notification(self, timeout=1):
raise WebSocketException("WebSocket client not available as expected")

try:
async with asyncio.timeout(timeout):
d = await self.ws.recv()
d = await asyncio.wait_for(self.ws.recv(), timeout)
log.debug(f"Recv: {d!r}")
return json.loads(d)
except Exception:
Expand All @@ -265,8 +264,7 @@ async def get_broadcast(self, timeout=1): # pragma: no cover
raise WebSocketException("WebSocket client not available as expected")

try:
async with asyncio.timeout(timeout):
d = await self.ws.recv()
d = await asyncio.wait_for(self.ws.recv(), timeout)
log.debug(f"Recv: {d}")
result = json.loads(d)
assert result.get("messageType") == ClientMessageType.BROADCAST.value
Expand Down

0 comments on commit 367ecd9

Please sign in to comment.