Skip to content

Commit d3c24c5

Browse files
fix(test): update references from app to fastapi_app in test_api_postgres.py
- Change import from api.main to fastapi_app - Update dependency overrides to use fastapi_app - Adjust AsyncClient instantiation to reference fastapi_app
1 parent 60e9b0c commit d3c24c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/e2e/test_api_postgres.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from api.cache import clear_cache
1818
from api.dependencies import get_db
19-
from api.main import app
19+
from api.main import fastapi_app
2020

2121

2222
pytestmark = pytest.mark.e2e
@@ -36,14 +36,14 @@ async def client(pg_db_with_data):
3636
async def override_get_db():
3737
yield pg_db_with_data
3838

39-
app.dependency_overrides[get_db] = override_get_db
39+
fastapi_app.dependency_overrides[get_db] = override_get_db
4040

4141
# Patch is_db_configured to return True (it checks env vars, not dependencies)
4242
with patch("api.dependencies.is_db_configured", return_value=True):
43-
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac:
43+
async with AsyncClient(transport=ASGITransport(app=fastapi_app), base_url="http://test") as ac:
4444
yield ac
4545

46-
app.dependency_overrides.clear()
46+
fastapi_app.dependency_overrides.clear()
4747

4848

4949
class TestSpecsEndpoints:

0 commit comments

Comments
 (0)