10 lines
371 B
Python
10 lines
371 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") |