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

Method _test_cancellation_recovery

tests/test_connect.py:2100–2104  ·  view source on GitHub ↗
(self, con)

Source from the content-addressed store, hash-verified

2098 await con.close()
2099
2100 async def _test_cancellation_recovery(self, con):
2101 self.assertEqual(await con.fetchval('SELECT 42'), 42)
2102 with self.assertRaises(asyncio.TimeoutError):
2103 await con.execute('SELECT pg_sleep(5)', timeout=0.5)
2104 self.assertEqual(await con.fetchval('SELECT 43'), 43)
2105
2106 async def _test_pool(self, *, expected_ssl, **conn_args):
2107 pool = await self.create_pool(min_size=5, max_size=10, **conn_args)

Callers 3

workerMethod · 0.95

Calls 2

fetchvalMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected