MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / test_timeout_02

Method test_timeout_02

tests/test_timeout.py:28–36  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 self.assertEqual(await self.con.fetch('select 1'), [(1,)])
27
28 async def test_timeout_02(self):
29 st = await self.con.prepare('select pg_sleep(10)')
30
31 for methname in {'fetch', 'fetchrow', 'fetchval'}:
32 with self.assertRaises(asyncio.TimeoutError), \
33 self.assertRunUnder(MAX_RUNTIME):
34 meth = getattr(st, methname)
35 await meth(timeout=0.02)
36 self.assertEqual(await self.con.fetch('select 1'), [(1,)])
37
38 async def test_timeout_03(self):
39 task = self.loop.create_task(

Callers

nothing calls this directly

Calls 3

prepareMethod · 0.80
assertRunUnderMethod · 0.80
fetchMethod · 0.45

Tested by

no test coverage detected