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

Method test_pool_05

tests/test_pool.py:125–139  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

123 pool.terminate()
124
125 async def test_pool_05(self):
126 for n in {1, 3, 5, 10, 20, 100}:
127 with self.subTest(tasksnum=n):
128 pool = await self.create_pool(database='postgres',
129 init_size=5,
130 min_size=1,
131 max_size=10)
132
133 async def worker():
134 async with pool.acquire() as con:
135 self.assertEqual(await con.fetchval('SELECT 1'), 1)
136
137 tasks = [worker() for _ in range(n)]
138 await asyncio.gather(*tasks)
139 await pool.close()
140
141 async def test_pool_06(self):
142 fut = asyncio.Future()

Callers

nothing calls this directly

Calls 2

create_poolMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected