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