(self)
| 56 | await asyncio.wait_for(wait(), 5) |
| 57 | |
| 58 | async def test_pool_01(self): |
| 59 | for n in {1, 5, 10, 20, 100}: |
| 60 | with self.subTest(tasksnum=n): |
| 61 | pool = await self.create_pool(database='postgres', |
| 62 | init_size=5, |
| 63 | min_size=1, |
| 64 | max_size=10) |
| 65 | |
| 66 | async def worker(): |
| 67 | con = await pool.acquire() |
| 68 | self.assertEqual(await con.fetchval('SELECT 1'), 1) |
| 69 | await pool.release(con) |
| 70 | |
| 71 | tasks = [worker() for _ in range(n)] |
| 72 | await asyncio.gather(*tasks) |
| 73 | await pool.close() |
| 74 | |
| 75 | async def test_pool_02(self): |
| 76 | for n in {1, 3, 5, 10, 20, 100}: |
nothing calls this directly
no test coverage detected