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

Method interrupted_connector

tests/test_connect.py:1766–1772  ·  view source on GitHub ↗
(factory, *args, **kwargs)

Source from the content-addressed store, hash-verified

1764 for connection_lost_first in (False, True):
1765 with self.subTest(connection_lost_first=connection_lost_first):
1766 async def interrupted_connector(factory, *args, **kwargs):
1767 proto = factory()
1768 if connection_lost_first:
1769 proto.connection_lost(None)
1770 else:
1771 self.loop.call_soon(proto.connection_lost, None)
1772 raise asyncio.CancelledError
1773
1774 with unittest.mock.patch.object(
1775 self.loop, 'create_connection', interrupted_connector,

Callers

nothing calls this directly

Calls 1

connection_lostMethod · 0.45

Tested by

no test coverage detected