From 5ece79dc0f13268c0afeadcaaf4fd4d5dea9493c Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Mon, 13 Nov 2023 17:11:59 +0100 Subject: [PATCH] test(db): check foreign_keys constraints during unit tests --- tests/conftest_db.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/conftest_db.py b/tests/conftest_db.py index 7396178116..925e0fe639 100644 --- a/tests/conftest_db.py +++ b/tests/conftest_db.py @@ -21,6 +21,7 @@ def db_engine_fixture() -> t.Generator[Engine, None, None]: An instance of the created SQLite database engine. """ engine = create_engine("sqlite:///:memory:") + engine.execute("PRAGMA foreign_keys = ON") Base.metadata.create_all(engine) yield engine engine.dispose()