fix(tests): isolate SQLite test databases
Co-authored-by: OpenAI/GPT-5.6-Terra <vibecoder@antoineve.me>
This commit is contained in:
@@ -2,6 +2,7 @@ import pytest
|
||||
|
||||
from app import create_app
|
||||
from app import db as _db
|
||||
from tests.in_memory_db import IN_MEMORY_DATABASE_URI, in_memory_engine_options
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -72,9 +73,12 @@ forfait = 0
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
application = create_app(config_path=str(config_path))
|
||||
application = create_app(
|
||||
config_path=str(config_path),
|
||||
database_uri=IN_MEMORY_DATABASE_URI,
|
||||
engine_options=in_memory_engine_options(),
|
||||
)
|
||||
application.config["TESTING"] = True
|
||||
application.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:"
|
||||
|
||||
with application.app_context():
|
||||
_db.create_all()
|
||||
|
||||
Reference in New Issue
Block a user