MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _test_works

Method _test_works

tests/test_connect.py:2091–2098  ·  view source on GitHub ↗
(self, *, expected_ssl=None, **conn_args)

Source from the content-addressed store, hash-verified

2089 database='postgres', user='ssl_user', auth_method=auth_method)
2090
2091 async def _test_works(self, *, expected_ssl=None, **conn_args):
2092 con = await self.connect(**conn_args)
2093 try:
2094 self.assertEqual(await con.fetchval('SELECT 42'), 42)
2095 if expected_ssl is not None:
2096 self.assertEqual(con._protocol.is_ssl, expected_ssl)
2097 finally:
2098 await con.close()
2099
2100 async def _test_cancellation_recovery(self, con):
2101 self.assertEqual(await con.fetchval('SELECT 42'), 42)

Calls 3

connectMethod · 0.95
fetchvalMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected