Skip to content

Commit 9151d0b

Browse files
committed
fix httpx deprecation warning in tests and stop pinning old version
Signed-off-by: Grant Ramsay <seapagan@gmail.com>
1 parent c3e1b25 commit 9151d0b

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies = [
2424
"rtoml>=0.11.0",
2525
"jinja2>=3.1.4",
2626
"fastapi-mail>=1.4.1",
27-
"httpx==0.27.2",
27+
"httpx>=0.27.2",
2828
"uvicorn[standard]>=0.32.0",
2929
"passlib[bcrypt]>=1.7.4",
3030
"sqlalchemy[asyncio]>=2.0.36",

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ h11==0.14.0
4848
htmlmin2==0.1.13
4949
httpcore==1.0.7
5050
httptools==0.6.4
51-
httpx==0.27.2
51+
httpx==0.28.1
5252
identify==2.6.6
5353
idna==3.10
5454
importlib-metadata==8.6.1 ; python_full_version < '3.10'

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ greenlet==3.1.1
2222
h11==0.14.0
2323
httpcore==1.0.7
2424
httptools==0.6.4
25-
httpx==0.27.2
25+
httpx==0.28.1
2626
idna==3.10
2727
jinja2==3.1.5
2828
mako==1.3.8

tests/conftest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import pytest
1010
import pytest_asyncio
11-
from httpx import AsyncClient
11+
from httpx import ASGITransport, AsyncClient
1212
from sqlalchemy.ext.asyncio import (
1313
AsyncEngine,
1414
AsyncSession,
@@ -93,8 +93,11 @@ async def test_db() -> AsyncGenerator[AsyncSession, Any]:
9393
async def client() -> AsyncGenerator[AsyncClient, Any]:
9494
"""Fixture to yield a test client for the app."""
9595
app.dependency_overrides[get_database] = get_database_override
96+
97+
transport = ASGITransport(app=app)
98+
9699
async with AsyncClient(
97-
app=app,
100+
transport=transport,
98101
base_url="http://testserver",
99102
headers={"Content-Type": "application/json"},
100103
timeout=10,

uv.lock

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)