From c4c17e3e046a627a7d2353c734bc69f05d4fc3b1 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 17 Nov 2026 21:06:05 +0100 Subject: feat(core): add configurable SQLite pragmas Apply validated SQLite settings through SQLAlchemy's connection event so every SQLite connection and bind receives consistent foreign key, WAL, timeout, and security defaults. Allow deployments to override supported PRAGMAs safely while skipping file-only settings for in-memory databases and leaving other database backends untouched. --- tests/conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/conftest.py') diff --git a/tests/conftest.py b/tests/conftest.py index d4336b0..4b1da24 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,13 +17,15 @@ def app() -> Iterator[Flask]: application = create_app(TestingConfig) with application.app_context(): - db.create_all() + # Only create the default database. Separate tests register transient + # bind metadata on the shared SQLAlchemy extension. + db.create_all(bind_key=None) yield application with application.app_context(): db.session.remove() - db.drop_all() + db.drop_all(bind_key=None) db.engine.dispose() -- cgit v1.3.1