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

Method verify_fails

tests/test_connect.py:1848–1860  ·  view source on GitHub ↗
(sslmode)

Source from the content-addressed store, hash-verified

1846 await con.close()
1847
1848 async def verify_fails(sslmode):
1849 con = None
1850 try:
1851 with self.assertRaises(ConnectionError):
1852 con = await self.connect(
1853 dsn='postgresql://foo/?sslmode=' + sslmode,
1854 user='postgres',
1855 database='postgres',
1856 host='localhost')
1857 await con.fetchval('SELECT 42')
1858 finally:
1859 if con:
1860 await con.close()
1861
1862 await verify_works('disable')
1863 await verify_works('allow')

Callers

nothing calls this directly

Calls 3

connectMethod · 0.45
fetchvalMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected