diff --git a/tests/databases/edgy/test_middleware_data.py b/tests/databases/edgy/test_middleware_data.py index cd01463f..adf71297 100644 --- a/tests/databases/edgy/test_middleware_data.py +++ b/tests/databases/edgy/test_middleware_data.py @@ -7,7 +7,7 @@ import pytest from anyio import from_thread, sleep, to_thread from edgy import ObjectNotFound -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from lilya.middleware import DefineMiddleware as LilyaMiddleware from pydantic import BaseModel @@ -183,7 +183,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: await to_thread.run_sync(blocking_function) yield ac diff --git a/tests/databases/edgy/test_middleware_payload.py b/tests/databases/edgy/test_middleware_payload.py index ca0302d1..2be5240e 100644 --- a/tests/databases/edgy/test_middleware_payload.py +++ b/tests/databases/edgy/test_middleware_payload.py @@ -7,7 +7,7 @@ import pytest from anyio import from_thread, sleep, to_thread from edgy import ObjectNotFound -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from lilya.middleware import DefineMiddleware as LilyaMiddleware from pydantic import BaseModel @@ -183,7 +183,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: await to_thread.run_sync(blocking_function) yield ac diff --git a/tests/databases/edgy/test_serialization.py b/tests/databases/edgy/test_serialization.py index 741bc477..83db088e 100644 --- a/tests/databases/edgy/test_serialization.py +++ b/tests/databases/edgy/test_serialization.py @@ -5,7 +5,7 @@ import edgy import pytest -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from esmerald import Esmerald, Gateway, post from esmerald.conf import settings @@ -53,7 +53,7 @@ def app() -> Esmerald: @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: yield ac diff --git a/tests/databases/mongoz/test_middleware_data.py b/tests/databases/mongoz/test_middleware_data.py index 6545d515..791301af 100644 --- a/tests/databases/mongoz/test_middleware_data.py +++ b/tests/databases/mongoz/test_middleware_data.py @@ -6,7 +6,7 @@ import pytest from anyio import from_thread, sleep, to_thread -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from lilya.middleware import DefineMiddleware as LilyaMiddleware from mongoz import DocumentNotFound from pydantic import BaseModel @@ -173,7 +173,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: await to_thread.run_sync(blocking_function) yield ac diff --git a/tests/databases/mongoz/test_middleware_payload_on_gateway.py b/tests/databases/mongoz/test_middleware_payload_on_gateway.py index 900b3a53..b2566d94 100644 --- a/tests/databases/mongoz/test_middleware_payload_on_gateway.py +++ b/tests/databases/mongoz/test_middleware_payload_on_gateway.py @@ -6,7 +6,7 @@ import pytest from anyio import from_thread, sleep, to_thread -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from lilya.middleware import DefineMiddleware as LilyaMiddleware from mongoz import DocumentNotFound from pydantic import BaseModel @@ -177,7 +177,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: await to_thread.run_sync(blocking_function) yield ac diff --git a/tests/databases/mongoz/test_middleware_payload_on_handler.py b/tests/databases/mongoz/test_middleware_payload_on_handler.py index 4eabf706..8ba5e514 100644 --- a/tests/databases/mongoz/test_middleware_payload_on_handler.py +++ b/tests/databases/mongoz/test_middleware_payload_on_handler.py @@ -6,7 +6,7 @@ import pytest from anyio import from_thread, sleep, to_thread -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from lilya.middleware import DefineMiddleware as LilyaMiddleware from mongoz import DocumentNotFound from pydantic import BaseModel @@ -176,7 +176,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: await to_thread.run_sync(blocking_function) yield ac diff --git a/tests/databases/saffier/test_middleware_data.py b/tests/databases/saffier/test_middleware_data.py index 614d420c..81da002c 100644 --- a/tests/databases/saffier/test_middleware_data.py +++ b/tests/databases/saffier/test_middleware_data.py @@ -6,7 +6,7 @@ import pytest from anyio import from_thread, sleep, to_thread -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from lilya.middleware import DefineMiddleware as LilyaMiddleware from pydantic import BaseModel from saffier.exceptions import DoesNotFound @@ -190,7 +190,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: await to_thread.run_sync(blocking_function) yield ac diff --git a/tests/databases/saffier/test_middleware_payload.py b/tests/databases/saffier/test_middleware_payload.py index 0cde837f..17acd97f 100644 --- a/tests/databases/saffier/test_middleware_payload.py +++ b/tests/databases/saffier/test_middleware_payload.py @@ -6,7 +6,7 @@ import pytest from anyio import from_thread, sleep, to_thread -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from lilya.middleware import DefineMiddleware as LilyaMiddleware from pydantic import BaseModel from saffier.exceptions import DoesNotFound @@ -190,7 +190,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: await to_thread.run_sync(blocking_function) yield ac diff --git a/tests/dependencies/test_simple_case_injected.py b/tests/dependencies/test_simple_case_injected.py index f95a2651..d5e941f7 100644 --- a/tests/dependencies/test_simple_case_injected.py +++ b/tests/dependencies/test_simple_case_injected.py @@ -2,7 +2,7 @@ import edgy import pytest -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from pydantic import BaseModel from esmerald import Esmerald, post @@ -72,7 +72,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: yield ac diff --git a/tests/dependencies/test_simple_case_injected_no_construct.py b/tests/dependencies/test_simple_case_injected_no_construct.py index 8e6fa15b..9b77366d 100644 --- a/tests/dependencies/test_simple_case_injected_no_construct.py +++ b/tests/dependencies/test_simple_case_injected_no_construct.py @@ -2,7 +2,7 @@ import edgy import pytest -from httpx import AsyncClient +from httpx import ASGITransport, AsyncClient from pydantic import BaseModel from esmerald import Esmerald, post @@ -71,7 +71,7 @@ def app(): @pytest.fixture() async def async_client(app) -> AsyncGenerator: - async with AsyncClient(app=app, base_url="http://test") as ac: + async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as ac: yield ac diff --git a/tests/requests/test_base_http_lilya.py b/tests/requests/test_base_http_lilya.py index 84cf6bb8..a4652391 100644 --- a/tests/requests/test_base_http_lilya.py +++ b/tests/requests/test_base_http_lilya.py @@ -99,7 +99,7 @@ async def app(scope: Any, receive: "Receive", send: "Send") -> None: assert response.json() == {"body": ""} response = client.post("/", json={"a": "123"}) - assert response.json() == {"body": '{"a": "123"}'} + assert response.json() == {"body": '{"a":"123"}'} response = client.post("/", data="abc") assert response.json() == {"body": "abc"} @@ -124,7 +124,7 @@ async def app(scope: Any, receive: "Receive", send: "Send") -> None: assert response.json() == {"body": ""} response = client.post("/", json={"a": "123"}) - assert response.json() == {"body": '{"a": "123"}'} + assert response.json() == {"body": '{"a":"123"}'} response = client.post("/", data="abc") assert response.json() == {"body": "abc"}