fix(mcp): scope fixture NullPool + suppression imports inutiles + validation enums + cleanup tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 23:03:43 +02:00
co-authored by Claude Sonnet 4.6
parent 05db49f27a
commit 6cd866c77a
3 changed files with 23 additions and 3 deletions
+13
View File
@@ -1,8 +1,21 @@
import json
import pytest
from sqlalchemy import delete
from app.api.mcp_server import (
get_todos, create_todo, update_todo, postpone_todo, delete_todo,
)
from app.core.database import AsyncSessionLocal
from app.models.todos import TodoItem
pytestmark = pytest.mark.usefixtures("mcp_nullpool_session")
@pytest.fixture(autouse=True)
async def cleanup_mcp_todos():
yield
async with AsyncSessionLocal() as session:
await session.execute(delete(TodoItem).where(TodoItem.title.like("TEST_MCP_%")))
await session.commit()
async def test_get_todos_retourne_liste_json():