refactor(api): remove MCP server integration and docs references

This commit is contained in:
Piotr Oleszczyk 2026-03-04 12:28:30 +01:00
parent 5dd8242985
commit 1d8a8eafb8
9 changed files with 9 additions and 1195 deletions

View file

@ -1,5 +1,4 @@
import os
from contextlib import asynccontextmanager
# Must be set before importing db (which calls create_engine at module level)
os.environ.setdefault("DATABASE_URL", "sqlite://")
@ -14,18 +13,6 @@ from db import get_session
from main import app
@asynccontextmanager
async def _db_only_lifespan(a):
"""Lifespan without the MCP server for test isolation.
StreamableHTTPSessionManager.run() can only be called once per instance,
which conflicts with the per-test TestClient lifecycle. We replace the
combined (db + MCP) lifespan with one that only does DB setup.
"""
db_module.create_db_and_tables()
yield
@pytest.fixture()
def session(monkeypatch):
"""Per-test fresh SQLite in-memory database with full isolation."""
@ -47,9 +34,6 @@ def session(monkeypatch):
@pytest.fixture()
def client(session, monkeypatch):
"""TestClient using the per-test session for every request."""
# Replace combined (db+MCP) lifespan with DB-only to avoid the
# StreamableHTTPSessionManager single-run limitation.
monkeypatch.setattr(app.router, "lifespan_context", _db_only_lifespan)
def _override():
yield session