(self, *, expected_ssl, **conn_args)
| 2104 | self.assertEqual(await con.fetchval('SELECT 43'), 43) |
| 2105 | |
| 2106 | async def _test_pool(self, *, expected_ssl, **conn_args): |
| 2107 | pool = await self.create_pool(min_size=5, max_size=10, **conn_args) |
| 2108 | |
| 2109 | async def worker(): |
| 2110 | async with pool.acquire() as con: |
| 2111 | self.assertEqual(con._protocol.is_ssl, expected_ssl) |
| 2112 | await self._test_cancellation_recovery(con) |
| 2113 | |
| 2114 | tasks = [self.loop.create_task(worker()) for _ in range(100)] |
| 2115 | try: |
| 2116 | await asyncio.gather(*tasks) |
| 2117 | finally: |
| 2118 | for task in tasks: |
| 2119 | task.cancel() |
| 2120 | await asyncio.gather(*tasks, return_exceptions=True) |
| 2121 | await pool.close() |
| 2122 | |
| 2123 | async def _test_sslmode_works( |
| 2124 | self, sslmode, *, expected_ssl, host='localhost', |
no test coverage detected