refactor(tests): use client fixture for test isolation

Replace all AsyncClient instantiations in test_sources.py and test_jobs.py
with the shared  fixture from conftest.py. This ensures proper test
database isolation via dependency overrides.

- Remove imports of httpx AsyncClient, ASGITransport, and app
- Add client fixture parameter to all test functions
- Remove async with blocks around HTTP requests
- test_engine.py already uses db fixture correctly, no changes needed
This commit is contained in:
2026-05-11 21:37:55 +02:00
parent 58c4bc7f30
commit 19987d68a0
5 changed files with 205 additions and 229 deletions
+1
View File
@@ -3,6 +3,7 @@ from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager
from app.database import engine, Base
from app import models # noqa: F401 - registers models with Base.metadata
from app.routers import sources, jobs, executions, backups, settings, dashboard
@asynccontextmanager