Skip to content

Commit 1a8b887

Browse files
committed
calls to asyncio.sleep in ClockEventLoop force the sleeping loop
1 parent ce6a2c7 commit 1a8b887

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytest_asyncio/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ async def advance_time(self, seconds):
218218
self._offset += seconds
219219

220220
# ensure waiting callbacks are run before advancing the clock
221-
await asyncio.sleep(0)
221+
await asyncio.sleep(0, loop=self)
222222

223223
if seconds > 0:
224224
# Once the clock is adjusted, new tasks may have just been scheduled for running
225225
# in the next pass through the event loop and advance again for the task
226226
# that calls `advance_time`
227-
await asyncio.sleep(0)
228-
await asyncio.sleep(0)
227+
await asyncio.sleep(0, loop=self)
228+
await asyncio.sleep(0, loop=self)
229229

230230

231231
# maps marker to the name of the event loop fixture that will be available

0 commit comments

Comments
 (0)