Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
📝 Fix async test example not to trigger DeprecationWarning#12084
Merged
alejsdev merged 1 commit intofastapi:masterfromAug 30, 2024
Merged
📝 Fix async test example not to trigger DeprecationWarning#12084alejsdev merged 1 commit intofastapi:masterfrom
alejsdev merged 1 commit intofastapi:masterfrom
Conversation
The code sample in `docs_src/async_tests/test_main.py` triggers thefollowing deprecation warning with recent versions of `httpx`: DeprecationWarning: The 'app' shortcut is now deprecated. Use the explicit style 'transport=ASGITransport(app=...)' instead.We fix it as suggested by the warning.Note that due toencode/httpx#3111 the new wayof creating `AsyncClient` passes type checks only when using httpxversion 0.27.2 or newer. This is not a problem for FastAPI itself thoughbecause it does not type check code samples.
Contributor
📝 Docs preview for commit7d97dd8 at:https://d59f858c.fastapitiangolo.pages.dev Modified Pages |
Member
alejsdev commentedAug 30, 2024
Hi@marcinsulikowski, thanks for your interest in contributing. I already validated and the fix works, also, thanks for taking the time to update the docs' highlights. |
black-redoc pushed a commit to black-redoc/fastapi that referenced this pull requestSep 12, 2024
black-redoc pushed a commit to black-redoc/fastapi that referenced this pull requestSep 12, 2024
black-redoc pushed a commit to black-redoc/fastapi that referenced this pull requestSep 12, 2024
s-rigaud pushed a commit to s-rigaud/fastapi that referenced this pull requestJan 23, 2025
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 freeto 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.
The code sample in
docs_src/async_tests/test_main.pytriggers the following deprecation warning with recent versions ofhttpx:We fix it as suggested by the warning.
Note that due toencode/httpx#3111 the new way of creating
AsyncClientpasses type checks only when using httpx version 0.27.2 or newer. This is not a problem for FastAPI itself though because it does not type check code samples.