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

Method test_timeout_basic

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

Source from the content-addressed store, hash-verified

14class TimeoutTests(unittest.IsolatedAsyncioTestCase):
15
16 async def test_timeout_basic(self):
17 with self.assertRaises(TimeoutError):
18 async with asyncio.timeout(0.01) as cm:
19 await asyncio.sleep(10)
20 self.assertTrue(cm.expired())
21
22 async def test_timeout_at_basic(self):
23 loop = asyncio.get_running_loop()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected