Skip to content

Test collection fails: starlette 1.3.1 requires httpx2 but tests use httpx #985

@sei-ahouseholder

Description

@sei-ahouseholder

Summary

Starlette 1.3.1 (merged via PR #983) deprecates httpx in favor of httpx2 for use with starlette.testclient. Since filterwarnings = ["error"] is set in pyproject.toml, this deprecation warning is promoted to an error and causes collection to fail for three test packages.

Affected test paths

ERROR test/adapters/driven/test_delivery_inbox_url.py
ERROR test/adapters/driving/fastapi
ERROR test/demo

Error

starlette.exceptions.StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.

Fix

Replace httpx with httpx2 in dev dependencies (and any import httpx in test/adapter code that relies on starlette.testclient), or pin starlette < 1.3.1 until migration is complete.

Reproduction

uv run pytest test/adapters/driven/test_delivery_inbox_url.py

Introduced by the starlette upgrade in PR #983.

Metadata

Metadata

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions