Skip to content

Commit

Permalink
fix(tests): 🔧 set default DATABASE URI for the fake app context
Browse files Browse the repository at this point in the history
  • Loading branch information
kikkomep committed Aug 28, 2024
1 parent b478877 commit 77e008a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ def request_context(app_context, request):
@pytest.fixture
def fake_app_context(request):
try:
yield from helpers.app_context(request.param, clean_db=False, init_db=False, drop_db=False)
# init reference to the settings
settings = request.param if request else {}
# always add a fake SQLALCHEMY_DATABASE_URI to the context settings
settings.update({"SQLALCHEMY_DATABASE_URI": "sqlite:///:memory:"})
yield from helpers.app_context(settings, clean_db=False, init_db=False, drop_db=False)
except AttributeError:
raise RuntimeError("Parametrized fixture. "
"You need to provide app settings as dict type in the request param")
Expand Down

0 comments on commit 77e008a

Please sign in to comment.