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

Method test_timeout_at_basic

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

Source from the content-addressed store, hash-verified

20 self.assertTrue(cm.expired())
21
22 async def test_timeout_at_basic(self):
23 loop = asyncio.get_running_loop()
24
25 with self.assertRaises(TimeoutError):
26 deadline = loop.time() + 0.01
27 async with asyncio.timeout_at(deadline) as cm:
28 await asyncio.sleep(10)
29 self.assertTrue(cm.expired())
30 self.assertEqual(deadline, cm.when())
31
32 async def test_nested_timeouts(self):
33 loop = asyncio.get_running_loop()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected