Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

📝 Fix async test example not to trigger DeprecationWarning#12084

Merged
alejsdev merged 1 commit intofastapi:masterfrom
marcinsulikowski:fix-async-test-code-sample
Aug 30, 2024
Merged

📝 Fix async test example not to trigger DeprecationWarning#12084
alejsdev merged 1 commit intofastapi:masterfrom
marcinsulikowski:fix-async-test-code-sample

Conversation

@marcinsulikowski
Copy link
Contributor

The code sample indocs_src/async_tests/test_main.py triggers the following deprecation warning with recent versions ofhttpx:

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 way of creatingAsyncClient passes 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.

alejsdev reacted with rocket emoji
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.
@github-actionsgithub-actionsbot added the docsDocumentation about how to use FastAPI labelAug 28, 2024
@alejsdevalejsdev merged commit6e98249 intofastapi:masterAug 30, 2024
@alejsdev
Copy link
Member

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.
Thanks for your help! 🙇‍♀️ 🚀

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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

docsDocumentation about how to use FastAPI

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@marcinsulikowski@alejsdev

Comments


[8]ページ先頭

©2009-2026 Movatter.jp