Fixed the rest of the warnings

Refs https://github.com/simonw/datasette/pull/2615#issuecomment-3649771920
This commit is contained in:
Simon Willison 2025-12-13 12:16:57 -08:00
commit 8895c4a202
8 changed files with 528 additions and 264 deletions

View file

@ -23,6 +23,14 @@ async def datasette_with_plugin():
yield datasette
finally:
datasette.pm.unregister(name="undo")
# Close databases first (while executor is still running)
for db in datasette.databases.values():
db.close()
if hasattr(datasette, "_internal_database"):
datasette._internal_database.close()
# Then shut down executor
if datasette.executor is not None:
datasette.executor.shutdown(wait=True)
# -- end datasette_with_plugin_fixture --