Skip to content

Commit f04121b

Browse files
committed
Adjusted test to cope with Python 3.10, in which there are two TimeoutError classes, one in builtins and one in asyncio.exceptions.
1 parent ad0424c commit f04121b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_client_async.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2779,7 +2779,9 @@ async def sleep_then_stop() -> None:
27792779
async def sleep_then_stop_with_timeout() -> None:
27802780
await reqs.stop(timeout=1)
27812781

2782-
with self.assertRaises(TimeoutError):
2782+
# NB asyncio.exceptions.TimeoutError is not the same
2783+
# as builtins.TimeoutError in Python 3.10.
2784+
with self.assertRaises(asyncio.exceptions.TimeoutError):
27832785
await sleep_then_stop_with_timeout()
27842786

27852787
# Can't call ack() after stopped.

0 commit comments

Comments
 (0)