Adjust testclient typing and warnings by waketzheng · Pull Request #3322 · Kludex/starlette (original) (raw)
Summary
- Move the
Selfimport behindTYPE_CHECKINGintestclient - Add clearer warning attribution for
TestClienttimeout deprecation warnings - Suppress the underlying
ModuleNotFoundErrorchain whenhttpx2/httpxis missing - Keep
WebSocketTestSession.__enter__typed asSelf
Checklist
- I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- I've updated the documentation accordingly.
[](/apps/cubic-dev-ai)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
| "You should not use the 'timeout' argument with the TestClient. " |
|---|
| "See https://github.com/Kludex/starlette/issues/1108 for more information.", |
| DeprecationWarning, |
| stacklevel=2, |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense.
| "You can install this with:\n" |
|---|
| " $ pip install httpx2\n" |
| ) |
| ) from None |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest that I didn't mark as "This makes sense" I don't think makes sense.
…ent-typing-warnings-20260607
…m:waketzheng/starlette into codex/testclient-typing-warnings-20260607
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
[ Show hidden characters]({{ revealButtonHref }})