def test_timeout_enable_zero(loop): with pytest.raises(asyncio.TimeoutError): with timeout(0, loop=loop) as cm: yield from asyncio.sleep(0.1, loop=loop) assert cm.expired