MCPcopy Index your code
hub / github.com/python/cpython / test_timeout_zero

Method test_timeout_zero

Lib/test/test_asyncio/test_timeouts.py:83–91  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

81 self.assertIsNone(cm.when())
82
83 async def test_timeout_zero(self):
84 loop = asyncio.get_running_loop()
85 t0 = loop.time()
86 with self.assertRaises(TimeoutError):
87 async with asyncio.timeout(0) as cm:
88 await asyncio.sleep(10)
89 t1 = loop.time()
90 self.assertTrue(cm.expired())
91 self.assertTrue(t0 <= cm.when() <= t1)
92
93 async def test_timeout_zero_sleep_zero(self):
94 loop = asyncio.get_running_loop()

Callers

nothing calls this directly

Calls 7

assertTrueMethod · 0.80
expiredMethod · 0.80
timeMethod · 0.45
assertRaisesMethod · 0.45
timeoutMethod · 0.45
sleepMethod · 0.45
whenMethod · 0.45

Tested by

no test coverage detected