MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / setup_test

Method setup_test

test/engine/test_reconnect.py:387–401  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

385
386class MockReconnectTest(fixtures.TestBase):
387 def setup_test(self):
388 self.dbapi = MockDBAPI()
389
390 self.db = testing_engine(
391 "postgresql+psycopg2://foo:bar@localhost/test",
392 options=dict(module=self.dbapi, _initialize=False),
393 )
394
395 self.mock_connect = call(
396 host="localhost", password="bar", user="foo", dbname="test"
397 )
398 # monkeypatch disconnect checker
399 self.db.dialect.is_disconnect = lambda e, conn, cursor: isinstance(
400 e, MockDisconnect
401 )
402
403 def teardown_test(self):
404 self.dbapi.dispose()

Callers

nothing calls this directly

Calls 3

testing_engineFunction · 0.90
callFunction · 0.85
MockDBAPIFunction · 0.70

Tested by

no test coverage detected