Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing fixes #777

Open
wants to merge 8 commits into
base: master
from
Open

Typing fixes #777

wants to merge 8 commits into from

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Jan 6, 2020

mypy starlette tests --ignore-missing-imports --check-untyped-defs passed (except for #780).

@blueyed blueyed force-pushed the blueyed:fix-typing branch from 2765013 to 132501a Jan 6, 2020
@blueyed blueyed changed the title Fix type for TestClient.__enter__ [WIP] Typing fixes Jan 6, 2020
@blueyed blueyed force-pushed the blueyed:fix-typing branch 2 times, most recently from 24c5c61 to 6dfea84 Jan 6, 2020
@blueyed blueyed force-pushed the blueyed:fix-typing branch 2 times, most recently from 9a4c14f to 8fd1663 Jan 6, 2020
@blueyed blueyed force-pushed the blueyed:fix-typing branch from 8fd1663 to f8eb880 Jan 6, 2020
@blueyed blueyed changed the title [WIP] Typing fixes Typing fixes Jan 6, 2020
@@ -10,6 +10,14 @@
from starlette.types import Message, Receive, Scope, Send
from starlette.websockets import WebSocket

if False: # TYPE_CHECKING

This comment has been minimized.

@florimondmanca

florimondmanca Mar 25, 2020
Member

There's a built-in flag in typing for this :-)

Suggested change
if False: # TYPE_CHECKING
if typing.TYPE_CHECKING:

This comment has been minimized.

@blueyed

blueyed Mar 25, 2020
Author Contributor

Yes, makes sense (given that this is py36+), thanks!
Not going to update it for now though, given its staleness already.

@JayH5 JayH5 added the typing label Sep 11, 2020
@and-semakin
Copy link
Contributor

@and-semakin and-semakin commented Oct 2, 2020

What's the status of this PR? It contains the fix of one little typing annoyance I was going to suggest.

@@ -449,7 +449,7 @@ def websocket_connect(

return session

def __enter__(self) -> requests.Session:
def __enter__(self) -> "TestClient":

This comment has been minimized.

@and-semakin

and-semakin Oct 2, 2020
Contributor

Would be nice to have this fix merged.

This comment has been minimized.

@and-semakin

and-semakin Oct 2, 2020
Contributor

Here we go #1064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.