Skip to content

Commit

Permalink
test(db): check foreign_keys constraints during unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-laporte-pro committed Nov 13, 2023
1 parent db391cb commit 5ece79d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/conftest_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5ece79d

Please sign in to comment.