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

Method _test_sslmode_fails

tests/test_connect.py:2130–2143  ·  view source on GitHub ↗
(
        self, sslmode, *, host='localhost',
        exc_type=asyncpg.InvalidAuthorizationSpecificationError,
    )

Source from the content-addressed store, hash-verified

2128 host=host, user='ssl_user', expected_ssl=expected_ssl)
2129
2130 async def _test_sslmode_fails(
2131 self, sslmode, *, host='localhost',
2132 exc_type=asyncpg.InvalidAuthorizationSpecificationError,
2133 ):
2134 # XXX: uvloop artifact
2135 old_handler = self.loop.get_exception_handler()
2136 try:
2137 self.loop.set_exception_handler(lambda *args: None)
2138 with self.assertRaises(exc_type):
2139 await self._test_works(
2140 dsn='postgresql://foo/?sslmode=' + sslmode,
2141 host=host, user='ssl_user')
2142 finally:
2143 self.loop.set_exception_handler(old_handler)
2144
2145 async def _test_connect_interruption(self, *, ready, cancel, **conn_args):
2146 async def connect():

Calls 1

_test_worksMethod · 0.95

Tested by

no test coverage detected