Skip to content

Commit 69f9de0

Browse files
authored
tests: Use an explicit transport for httpx (#336)
httpx deprecated the `app` shortcut in 0.27 and removed it altogether in 0.28. Use the recommended `ASGITransport` transport to replace it.
1 parent 11bfe35 commit 69f9de0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/main/test_generated_client.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77
from click.testing import CliRunner
8-
from httpx import AsyncClient
8+
from httpx import ASGITransport, AsyncClient
99

1010
from ariadne_codegen.main import main
1111

@@ -46,7 +46,8 @@ def generated_client(tmp_path_factory):
4646

4747
@pytest.fixture
4848
def http_client():
49-
return AsyncClient(base_url="http://127.0.0.1:8000", app=api_app)
49+
transport = ASGITransport(app=api_app)
50+
return AsyncClient(base_url="http://127.0.0.1:8000", transport=transport)
5051

5152

5253
@pytest.fixture

0 commit comments

Comments
 (0)