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

Method worker

tests/test_connect.py:2228–2236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2226 ssl='prefer')
2227
2228 async def worker():
2229 async with pool.acquire() as con:
2230 self.assertFalse(con._protocol.is_ssl)
2231 self.assertEqual(await con.fetchval('SELECT 42'), 42)
2232
2233 with self.assertRaises(asyncio.TimeoutError):
2234 await con.execute('SELECT pg_sleep(5)', timeout=0.5)
2235
2236 self.assertEqual(await con.fetchval('SELECT 43'), 43)
2237
2238 tasks = [worker() for _ in range(100)]
2239 await asyncio.gather(*tasks)

Callers

nothing calls this directly

Calls 3

acquireMethod · 0.45
fetchvalMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected