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)
| 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") |