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

Add type hints to test_testclient.py #2493

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

TechNiick
Copy link
Contributor

Summary

Related to this
Type annotation added to test_testclient.py

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.

from contextlib import asynccontextmanager
from typing import Callable
from typing import Any, AsyncGenerator, Awaitable, Callable, Union
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove Any, please.

Use | instead of Union.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file, Any is used only here:

def current_task() -> Task[Any] | trio.lowlevel.Task:

I couldn't figure it out what type should be there instead of Any. Could you help me on this one please?

@Kludex Kludex enabled auto-merge (squash) February 9, 2024 09:11
@Kludex Kludex merged commit 3f38038 into encode:master Feb 9, 2024
5 checks passed
nixroxursox pushed a commit to nixroxursox/starlette that referenced this pull request Mar 18, 2024
* Add type hints to test_testclient.py

* Fix check errors

* Apply suggestions from code review

* Use ASGIInstance instead

---------

Co-authored-by: Scirlat Danut <scirlatdanut@scirlats-mini.lan>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants