Use StarletteDeprecationWarning instead of DeprecationWarning#3119
Merged
Conversation
…tion-warning # Conflicts: # starlette/responses.py # starlette/testclient.py # tests/test_responses.py
Contributor
StarletteDeprecationWarningStarletteDeprecationWarning instead of DeprecationWarning
bod-zol
added a commit
to bod-zol/fastapi-easy-responses
that referenced
this pull request
Jun 22, 2026
- add httpx2 as dev dependency, because since starlette Kludex/starlette#3291 (version1.2.0) a warning is issued if the httpx2 module is unavailable for the TestClient - Kludex/starlette#3119 (v1.3.1) made this a more visible warning - parallelly in #14 I introduced to handle all warnings as errors in unit tests - these caused the tests to fail for this version bump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert the remaining Starlette-emitted
DeprecationWarnings toStarletteDeprecationWarning.The
StarletteDeprecationWarningclass itself (and its use inTestClientfor the httpx deprecation) already landed via #3291, so this PR only covers the leftover call sites:run_until_first_complete,starlette.middleware.wsgi, the lifespan deprecations inrouting, the deprecatedstatusconstants, and theTestClienttimeoutargument. Thefilterwarningsentries are updated to match.Rationale: a
UserWarningsubclass is visible by default, so deprecations reach users without them having to enable warnings explicitly. See https://sethmlarson.dev/deprecations-via-warnings-dont-work-for-python-librariesAI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.