def test_async_zero_coro_not_started(loop):
coro_started = False
async def coro():
nonlocal coro_started
coro_started = True
with pytest.raises(asyncio.TimeoutError):
async with timeout(0, loop=loop) as cm:
await asyncio.sleep(0, loop=loop)
await coro()
assert cm.expired
assert coro_started is False
评论列表
文章目录