|
|
@@ -12,6 +12,18 @@ from httpx import AsyncClient, ASGITransport
|
|
|
from app.main import app
|
|
|
|
|
|
|
|
|
+@pytest.fixture(scope="session", autouse=True)
|
|
|
+async def _init_checkpointer_global():
|
|
|
+ """B-74 修复(2026-11-09):httpx.ASGITransport 直连不触发 FastAPI
|
|
|
+ @app.on_event("startup"),导致 app/checkpointer.py 的 init_checkpointer()
|
|
|
+ 从未执行、全局单例保持 None,凡走 graph 的用例(test_auto_tag×5 /
|
|
|
+ test_chat×1)恒 500。session 级 autouse fixture 在任何用例前显式初始化
|
|
|
+ checkpointer(init_checkpointer 幂等,已初始化则直接返回,不影响生产)。"""
|
|
|
+ from app.checkpointer import init_checkpointer
|
|
|
+ await init_checkpointer()
|
|
|
+ yield
|
|
|
+
|
|
|
+
|
|
|
@pytest.fixture
|
|
|
async def client():
|
|
|
transport = ASGITransport(app=app)
|