async def go(): scheduler = AsyncIOScheduler(loop) ran = False def action(scheduler, state): nonlocal ran ran = True scheduler.schedule(action) await asyncio.sleep(0.1) assert ran is True
def go(): scheduler = AsyncIOScheduler(loop) ran = False def action(scheduler, state): nonlocal ran ran = True scheduler.schedule(action) yield from asyncio.sleep(0.1, loop=loop) assert ran is True