Skip to content

Commit

Permalink
Update CI (#448)
Browse files Browse the repository at this point in the history
* Fix new httpx dependency
* Fix missing parameters in tests
  • Loading branch information
tarsil authored Nov 29, 2024
1 parent cfbe804 commit 0e7329f
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions tests/databases/edgy/test_middleware_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/databases/edgy/test_middleware_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/databases/edgy/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions tests/databases/mongoz/test_middleware_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/databases/mongoz/test_middleware_payload_on_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/databases/mongoz/test_middleware_payload_on_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/databases/saffier/test_middleware_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/databases/saffier/test_middleware_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/dependencies/test_simple_case_injected.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions tests/dependencies/test_simple_case_injected_no_construct.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions tests/requests/test_base_http_lilya.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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"}
Expand Down

0 comments on commit 0e7329f

Please sign in to comment.