-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
Add type hints to test_requests.py
#2481
Conversation
tests/test_requests.py
Outdated
scope: typing.Dict[str, typing.Any], | ||
receive: typing.Callable[[], typing.Awaitable[typing.Dict[str, typing.Any]]], | ||
send: typing.Callable[ | ||
[typing.MutableMapping[str, typing.Any]], typing.Awaitable[None] | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you not using Scope
, Receive
, and Send
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated those in all places in this file.
Just a small note:
There are some places where I have added: test_client_factory: typing.Any
. In those places I get an error when i try to use the TestClientFactory
:
example: Argument "data" to "post" of "TestClient" has incompatible type "str"; expected "Optional[Mapping[str, Union[str, Iterable[str]]]]"
tests/test_requests.py
Outdated
from starlette.types import ( | ||
Message, | ||
Receive, | ||
Scope, | ||
Send, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix those.
from starlette.types import ( | |
Message, | |
Receive, | |
Scope, | |
Send, | |
) | |
from starlette.types import Message, Receive, Scope, Send |
…arlette into improve-types/test_requests
test_requests.py
test_requests.py
test_requests.py
* added type annotations to test_requests.py * requested changes * indentations * typos * typos * Apply suggestions from code review * Apply suggestions from code review --------- Co-authored-by: Scirlat Danut <[email protected]> Co-authored-by: Marcelo Trylesinski <[email protected]>
Summary
Related to this
Type annotation added to
test_requests.py
Checklist