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

Method connect

tests/test_connect.py:2146–2153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2144
2145 async def _test_connect_interruption(self, *, ready, cancel, **conn_args):
2146 async def connect():
2147 # Python 3.9 wraps CancelledError when it crosses a task boundary.
2148 # Capture the original exception so its cause can be checked.
2149 expected = (asyncio.CancelledError if cancel
2150 else asyncio.TimeoutError)
2151 with self.assertRaises(expected) as raised:
2152 await self.connect(timeout=2 if cancel else 0.2, **conn_args)
2153 return raised.exception
2154
2155 task = self.loop.create_task(connect())
2156 try:

Calls

no outgoing calls

Tested by

no test coverage detected