MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_rec_unconnected

Method test_rec_unconnected

test/engine/test_pool.py:215–227  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

213 assert "foo2" in c2.record_info
214
215 def test_rec_unconnected(self):
216 # test production of a _ConnectionRecord with an
217 # initially unconnected state.
218
219 dbapi = MockDBAPI()
220 p1 = pool.Pool(creator=lambda: dbapi.connect("foo.db"))
221
222 r1 = pool._ConnectionRecord(p1, connect=False)
223
224 assert not r1.dbapi_connection
225 c1 = r1.get_connection()
226 is_(c1, r1.dbapi_connection)
227 is_(c1, r1.driver_connection)
228
229 def test_rec_close_reopen(self):
230 # test that _ConnectionRecord.close() allows

Callers

nothing calls this directly

Calls 4

is_Function · 0.90
get_connectionMethod · 0.80
MockDBAPIFunction · 0.70
connectMethod · 0.45

Tested by

no test coverage detected