good release 2.0 code name: chiki-puki
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -2,8 +2,7 @@ import pytest
|
||||
from httpx import AsyncClient, ASGITransport
|
||||
from app.main import app
|
||||
|
||||
# Убираем async def и yield. Это будет обычная, синхронная фикстура,
|
||||
# которая создает асинхронный клиент.
|
||||
# Убираем async def и yield чтобы было ок :)
|
||||
@pytest.fixture
|
||||
def client() -> AsyncClient:
|
||||
transport = ASGITransport(app=app)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_health_check(client): # <-- client - это теперь сам AsyncClient
|
||||
async def test_health_check(client): # <-- client - это сам AsyncClient
|
||||
async with client: # <-- Используем async with для управления контекстом
|
||||
response = await client.get("/")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user