MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / connect

Method connect

lib/sqlalchemy/testing/engines.py:250–261  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

248 return getattr(self.dbapi, key)
249
250 def connect(self, *args, **kwargs):
251 conn = self.dbapi.connect(*args, **kwargs)
252 if self.is_stopped:
253 self._safe(conn.close)
254 curs = conn.cursor() # should fail on Oracle etc.
255 # should fail for everything that didn't fail
256 # above, connection is closed
257 curs.execute("select 1")
258 assert False, "simulated connect failure didn't work"
259 else:
260 self.connections.append(conn)
261 return conn
262
263 def _safe(self, fn):
264 try:

Callers 15

get_isolation_levelsMethod · 0.45
goMethod · 0.45
setup_configFunction · 0.45
_server_versionFunction · 0.45
_assert_resultMethod · 0.45
_assert_resultMethod · 0.45
_assert_result_strMethod · 0.45
_assert_resultMethod · 0.45
_assert_resultMethod · 0.45
test_executeMethod · 0.45

Calls 4

_safeMethod · 0.95
cursorMethod · 0.45
executeMethod · 0.45
appendMethod · 0.45