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

Method _try_connect

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

Source from the content-addressed store, hash-verified

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

Calls 1

connectMethod · 0.45

Tested by

no test coverage detected