Skip to content

Commit 757aec3

Browse files
committed
test: assert cancellation is handled in test_resolve_cancellation_with_error
1 parent ce716bf commit 757aec3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_resolvers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,8 @@ async def slow_dns_resolve(*args, **kwargs):
185185
await trio.sleep(0.1)
186186
signal.cancel()
187187

188-
# The nursery should handle the cancellation
188+
# The nursery should handle the cancellation gracefully
189+
# If cancellation is not handled properly, this would raise an unhandled exception
190+
191+
# Verify that the signal was actually cancelled
192+
assert signal.cancel_called

0 commit comments

Comments
 (0)