MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_dispose_event

Method test_dispose_event

test/engine/test_execute.py:2422–2438  ·  view source on GitHub ↗
(self, testing_engine)

Source from the content-addressed store, hash-verified

2420 )
2421
2422 def test_dispose_event(self, testing_engine):
2423 canary = Mock()
2424 eng = testing_engine(testing.db.url)
2425 event.listen(eng, "engine_disposed", canary)
2426
2427 conn = eng.connect()
2428 conn.close()
2429 eng.dispose()
2430
2431 conn = eng.connect()
2432 conn.close()
2433
2434 eq_(canary.mock_calls, [call(eng)])
2435
2436 eng.dispose()
2437
2438 eq_(canary.mock_calls, [call(eng), call(eng)])
2439
2440 @testing.combinations(True, False, argnames="close")
2441 def test_close_parameter(self, testing_engine, close):

Callers

nothing calls this directly

Calls 6

eq_Function · 0.90
testing_engineFunction · 0.85
listenMethod · 0.45
connectMethod · 0.45
closeMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected