3591972014
Ajoute les schémas Pydantic TodoCreate/TodoUpdate/PostponeRequest/TodoResponse, la fixture db_session dans conftest, et 9 tests d'intégration contre PostgreSQL réel — tous en échec car les endpoints /api/todos/ n'existent pas encore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
390 B
Python
17 lines
390 B
Python
import pytest
|
|
from httpx import AsyncClient, ASGITransport
|
|
from app.main import app
|
|
from app.core.database import AsyncSessionLocal
|
|
|
|
|
|
@pytest.fixture
|
|
async def client():
|
|
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac:
|
|
yield ac
|
|
|
|
|
|
@pytest.fixture
|
|
async def db_session():
|
|
async with AsyncSessionLocal() as session:
|
|
yield session
|