Skip to content

Commit

Permalink
Work around Windows Python bug in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SaladDais committed Jan 10, 2024
1 parent 0778442 commit f0d9bfd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ async def test_command(self):

# Pretend a reply came in
self._write_reply(1, {"foo": 1})
self.assertEqual({"foo": 1}, await asyncio.wait_for(fut, timeout=0.01))
# Work around weird Windows-only bug in wait_for() in Windows Python 3.12 :(
# Seems that it doesn't return the result even though the future is marked done?
await asyncio.sleep(0)
self.assertEqual({"foo": 1}, await asyncio.wait_for(fut, timeout=0.05))

async def test_disconnect_pending_command(self):
self._write_welcome()
Expand Down

0 comments on commit f0d9bfd

Please sign in to comment.