Skip to content

Commit e7c0303

Browse files
committed
tests: replace asyncio.timeout(0) with await + suppress(CancelledError)
asyncio.timeout is 3.11+. After task.cancel(), awaiting the task raises CancelledError once cancellation propagates; suppressing it is equivalent to the previous TimeoutError-via-timeout(0) idiom and works on 3.10.
1 parent 1847b9e commit e7c0303

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tests/agent/test_agent.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ def _(notification: AllowedNotification):
5454
yield notifier
5555

5656
task.cancel()
57-
with suppress(asyncio.TimeoutError):
58-
async with asyncio.timeout(0):
59-
await task
57+
with suppress(asyncio.CancelledError):
58+
await task
6059

6160

6261
class TestAgentApi:

0 commit comments

Comments
 (0)