Skip to content

Commit 559e883

Browse files
committed
further simplify advance_time method
1 parent 8452d41 commit 559e883

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

pytest_asyncio/plugin.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,7 @@ def advance_time(self, seconds):
237237
'''
238238
if seconds <= 0:
239239
# cannot go backwards in time, so return after one iteration of a loop
240-
return asyncio.sleep(0)
241-
242-
# Add a task associated with iterating the currently "ready" tasks and handles
243-
#
244-
# NOTE: This can actually take place after the offset changed, but
245-
# it is here to highlight that the loop is for currently ready
246-
# items before offset is applied
247-
self.create_task(asyncio.sleep(0))
240+
return self.create_task(asyncio.sleep(0))
248241

249242
# advance the clock by the given offset
250243
self._offset += seconds

0 commit comments

Comments
 (0)