()
| 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) |