♻️ Refactor code to support new HTTPX-based TestClient#5350
Closed
♻️ Refactor code to support new HTTPX-based TestClient#5350
TestClient#5350Conversation
Contributor
Contributor
Member
|
bump-testclient makes almost all the changes you did. What it doesn't change still:
I'm working on the |
Member
Author
|
This is no longer needed, it was covered in another PR 🎉 🔥 |
vilmibm
pushed a commit
to internetarchive/fatcat-scholar
that referenced
this pull request
Feb 16, 2024
seemingly, this test hits a fallback path for resolving access urls and that fallback requires an API client; this issue may have started when starlette (ASGI) framework switched from requests to httpx. > So... the largest impact of this change will be for FastAPI devs. They're the largest install base, they're using the test client, and the change will introduce breaking changes into their test suites and require extra work for their teams. -- Kludex/starlette#1376 (comment) possible mitigations: upgrade fastapi, as per notes in notes in fastapi/fastapi#5350
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.
♻️ Refactor code to support new HTTPX-based
TestClientThis was done locally using @Kludex's branch of Starlette migrating the
TestClientto HTTPX.These are the changes that will be needed in FastAPI after that is merged.
One import in
applications.pywill be needed either way after upgrading Starlette.The rest of the changes all make sense and seem sensible. The code would probably make more sense after this. And although some users could need to update their test suite, their code would also look more sensible after the needed refactors.