def test_async_zero(loop): with pytest.raises(asyncio.TimeoutError): async with timeout(0, loop=loop) as cm: await asyncio.sleep(10, loop=loop) assert cm.expired