fix(tests): isolate SQLite test databases
Co-authored-by: OpenAI/GPT-5.6-Terra <vibecoder@antoineve.me>
This commit is contained in:
11
tests/test_app_factory.py
Normal file
11
tests/test_app_factory.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.pool import StaticPool
|
||||
|
||||
from app import db
|
||||
|
||||
|
||||
def test_app_fixture_uses_one_in_memory_database_connection(app):
|
||||
with app.app_context():
|
||||
assert str(db.engine.url) == "sqlite:///:memory:"
|
||||
assert isinstance(db.engine.pool, StaticPool)
|
||||
assert sa.inspect(db.engine).has_table("work_entries")
|
||||
Reference in New Issue
Block a user