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

Method verify_fails

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

Source from the content-addressed store, hash-verified

1722 await con.close()
1723
1724 async def verify_fails(sslmode):
1725 con = None
1726 try:
1727 with self.assertRaises(ConnectionError):
1728 con = await self.connect(
1729 dsn='postgresql://foo/?sslmode=' + sslmode,
1730 user='postgres',
1731 database='postgres',
1732 host='localhost')
1733 await con.fetchval('SELECT 42')
1734 finally:
1735 if con:
1736 await con.close()
1737
1738 await verify_works('disable')
1739 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