MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / test_timeout_02

Method test_timeout_02

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

assertRunUnderMethod · 0.80
prepareMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected