diff options
| author | Dennis Fink | 2026-11-17 21:06:05 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-17 21:06:05 +0100 |
| commit | c4c17e3e046a627a7d2353c734bc69f05d4fc3b1 (patch) | |
| tree | ebc343ce994c0c32243e1f8b7e654ee902d714bc /tests/conftest.py | |
| parent | 5e24e8307f650e72881f747661a2b6e52db15f2d (diff) | |
| download | webmentions-ssg-c4c17e3e046a627a7d2353c734bc69f05d4fc3b1.tar.gz webmentions-ssg-c4c17e3e046a627a7d2353c734bc69f05d4fc3b1.zip | |
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.
Diffstat (limited to 'tests/conftest.py')
| -rw-r--r-- | tests/conftest.py | 6 |
1 files changed, 4 insertions, 2 deletions
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() |
