def test_timeout_global_loop(loop):
asyncio.set_event_loop(loop)
@asyncio.coroutine
def run():
with timeout(10) as t:
yield from asyncio.sleep(0.01)
assert t._loop is loop
loop.run_until_complete(run())
文章目录