MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / dispose

Function dispose

lib/sqlalchemy/dialects/sqlite/provision.py:126–141  ·  view source on GitHub ↗

most databases should be dropped using stop_test_class_outside_fixtures however a few tests like AttachedDBTest might not get triggered on that main hook

(engine)

Source from the content-addressed store, hash-verified

124
125 @event.listens_for(engine, "engine_disposed")
126 def dispose(engine):
127 """most databases should be dropped using
128 stop_test_class_outside_fixtures
129
130 however a few tests like AttachedDBTest might not get triggered on
131 that main hook
132
133 """
134
135 if os.path.exists(attach_path):
136 os.remove(attach_path)
137
138 filename = engine.url.database
139
140 if filename and filename != ":memory:" and os.path.exists(filename):
141 os.remove(filename)
142
143
144@post_configure_testing_engine.for_db("sqlite")

Callers

nothing calls this directly

Calls 2

existsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected