MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_reconnect

Method test_reconnect

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

Source from the content-addressed store, hash-verified

2320
2321class NullPoolTest(PoolTestBase):
2322 def test_reconnect(self):
2323 dbapi = MockDBAPI()
2324 p = pool.NullPool(creator=lambda: dbapi.connect("foo.db"))
2325 c1 = p.connect()
2326
2327 c1.close()
2328 c1 = None
2329
2330 c1 = p.connect()
2331 c1.invalidate()
2332 c1 = None
2333
2334 c1 = p.connect()
2335 dbapi.connect.assert_has_calls(
2336 [call("foo.db"), call("foo.db")], any_order=True
2337 )
2338
2339
2340class StaticPoolTest(PoolTestBase):

Callers

nothing calls this directly

Calls 5

callFunction · 0.85
MockDBAPIFunction · 0.70
connectMethod · 0.45
closeMethod · 0.45
invalidateMethod · 0.45

Tested by

no test coverage detected