Skip to content

Commit e7d4620

Browse files
committed
Add comments about using Timeout class directly.
1 parent 634b4b3 commit e7d4620

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_timeout.py

+4
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ async def test_race_condition_cancel_before() -> None:
358358
"""
359359

360360
async def test_task(deadline: float, loop: asyncio.AbstractEventLoop) -> None:
361+
# We need the internal Timeout class to specify the deadline (not delay).
362+
# This is needed to create the precise timing to reproduce the race condition.
361363
with Timeout(deadline, loop):
362364
await asyncio.sleep(10)
363365

@@ -382,6 +384,8 @@ async def test_race_condition_cancel_after() -> None:
382384
"""
383385

384386
async def test_task(deadline: float, loop: asyncio.AbstractEventLoop) -> None:
387+
# We need the internal Timeout class to specify the deadline (not delay).
388+
# This is needed to create the precise timing to reproduce the race condition.
385389
with Timeout(deadline, loop):
386390
await asyncio.sleep(10)
387391

0 commit comments

Comments
 (0)