diff --git a/api/tests/test_auth_refresh_http.py b/api/tests/test_auth_refresh_http.py index 05f33ed..c36efc7 100644 --- a/api/tests/test_auth_refresh_http.py +++ b/api/tests/test_auth_refresh_http.py @@ -14,7 +14,7 @@ from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker from app.core.config import settings from app.core.db import get_async_db, utc_now -from app.core.dependencies import get_sms_sender +from app.core.dependencies import get_object_storage, get_sms_sender from app.features.auth import repo from app.features.auth.router import router as auth_router from tests.conftest import install_test_error_handlers @@ -33,6 +33,7 @@ async def refresh_http_app( app.include_router(auth_router) app.dependency_overrides[get_async_db] = _override_db app.dependency_overrides[get_sms_sender] = lambda: MagicMock() + app.dependency_overrides[get_object_storage] = lambda: MagicMock() return app diff --git a/api/tests/test_http_router_error_contract.py b/api/tests/test_http_router_error_contract.py index d6c114b..10d77c9 100644 --- a/api/tests/test_http_router_error_contract.py +++ b/api/tests/test_http_router_error_contract.py @@ -8,6 +8,7 @@ import pytest from fastapi import FastAPI from httpx import ASGITransport, AsyncClient +from app.core.dependencies import get_object_storage from app.core.errors import BadRequestError, NotFoundError from app.features.auth.deps import get_auth_service from app.features.auth.router import router as auth_router @@ -21,6 +22,7 @@ from tests.conftest import install_test_error_handlers async def test_auth_register_validation_returns_unified_422() -> None: app = install_test_error_handlers(FastAPI()) app.include_router(auth_router) + app.dependency_overrides[get_object_storage] = lambda: MagicMock() transport = ASGITransport(app=app, raise_app_exceptions=False) async with AsyncClient(transport=transport, base_url="http://test") as client: diff --git a/api/tests/test_ws_pipeline_transactional.py b/api/tests/test_ws_pipeline_transactional.py index d7c3619..ba73adf 100644 --- a/api/tests/test_ws_pipeline_transactional.py +++ b/api/tests/test_ws_pipeline_transactional.py @@ -133,10 +133,18 @@ async def test_record_human_ai_turn_with_segment_postgres_flush_order() -> None: if not settings.database_url.startswith("postgresql"): pytest.skip("requires PostgreSQL") + from sqlalchemy import text + from app.core.db import AsyncSessionLocal, transactional from app.features.conversation.models import Conversation from app.features.user.models import User + try: + async with AsyncSessionLocal() as db: + await db.execute(text("SELECT 1")) + except Exception: + pytest.skip("PostgreSQL not reachable") + uid = str(uuid.uuid4()) cid = str(uuid.uuid4()) sid = str(uuid.uuid4())