MCPcopy
hub / github.com/MagicStack/asyncpg / _try_connect

Method _try_connect

tests/test_connect.py:228–239  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

226 ]
227
228 async def _try_connect(self, **kwargs):
229 # On Windows the server sometimes just closes
230 # the connection sooner than we receive the
231 # actual error.
232 if _system == 'Windows':
233 for tried in range(3):
234 try:
235 return await self.connect(**kwargs)
236 except asyncpg.ConnectionDoesNotExistError:
237 pass
238
239 return await self.connect(**kwargs)
240
241 async def test_auth_bad_user(self):
242 with self.assertRaises(

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected