(self)
| 73 | await pool.close() |
| 74 | |
| 75 | async def test_pool_02(self): |
| 76 | for n in {1, 3, 5, 10, 20, 100}: |
| 77 | with self.subTest(tasksnum=n): |
| 78 | async with self.create_pool(database='postgres', |
| 79 | init_size=5, |
| 80 | min_size=1, |
| 81 | max_size=5) as pool: |
| 82 | |
| 83 | async def worker(): |
| 84 | con = await pool.acquire(timeout=5) |
| 85 | self.assertEqual(await con.fetchval('SELECT 1'), 1) |
| 86 | await pool.release(con) |
| 87 | |
| 88 | tasks = [worker() for _ in range(n)] |
| 89 | await asyncio.gather(*tasks) |
| 90 | |
| 91 | async def test_pool_03(self): |
| 92 | pool = await self.create_pool(database='postgres', |
nothing calls this directly
no test coverage detected