(self)
| 44 | class TestPool(tb.ConnectedTestCase): |
| 45 | |
| 46 | async def test_pool_01(self): |
| 47 | for n in {1, 5, 10, 20, 100}: |
| 48 | with self.subTest(tasksnum=n): |
| 49 | pool = await self.create_pool(database='postgres', |
| 50 | min_size=5, max_size=10) |
| 51 | |
| 52 | async def worker(): |
| 53 | con = await pool.acquire() |
| 54 | self.assertEqual(await con.fetchval('SELECT 1'), 1) |
| 55 | await pool.release(con) |
| 56 | |
| 57 | tasks = [worker() for _ in range(n)] |
| 58 | await asyncio.gather(*tasks) |
| 59 | await pool.close() |
| 60 | |
| 61 | async def test_pool_02(self): |
| 62 | for n in {1, 3, 5, 10, 20, 100}: |
nothing calls this directly
no test coverage detected