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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user