Files
marquiz-metrics/tests/conftest.py
13orlov 6fc14db51e
All checks were successful
continuous-integration/drone/push Build is passing
refactor(tests): Simplify test setup and fix client fixture
2025-08-23 22:36:23 +01:00

11 lines
486 B
Python

import pytest
from httpx import AsyncClient, ASGITransport
from app.main import app
# Убираем async def и yield. Это будет обычная, синхронная фикстура,
# которая создает асинхронный клиент.
@pytest.fixture
def client() -> AsyncClient:
transport = ASGITransport(app=app)
# Просто создаем и возвращаем клиент
return AsyncClient(transport=transport, base_url="http://test")