-
Notifications
You must be signed in to change notification settings - Fork 156
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
Decorator type signatures not recognized by pyright #731
Comments
Thanks. Pytest-asyncio is currently type checked with an outdated version of mypy. There's an issue to update the type checker: #596 I assume it would be helpful to also type check with pyright in the CI. Since pytest-asyncio v0.23 has functional issues that break some users' test suites, the typing issue you describe is not at the top of my priorities list at the moment. I hope you understand! |
@charles-dyfis-net pytest-asyncio-0.23.5a0 fixed some typing issues and removed the unbound type variable |
We're not running clean, but the specific issue this ticket was filed for is no longer present:
|
Thanks for checking. Resolving this issue would make for suitable first contribution to pytest-asyncio. I don't necessarily mean you, but anyone who is interested in working on this. If anyone wants to open a PR, I would expect:
|
...and according to pyright upstream, this is a bug in mypy, rather than in pyright.
Type-checking pytest-asyncio itself yields a great many errors, starting with:
...and type-checking a project that uses pytest-asyncio's decorators with
reportUntypedFunctionDecorator
set in pyright's configuration:I suspect that the option of either passing the function to be used as a fixture as a direct argument to
fixture()
or returning a function that acts as a proper decorator adds complexity here. If it's not possible to be pyright-friendly with the existing calling convention flexibility, might it make sense to offer a less-flexible, more explicitly-typed alternative?The text was updated successfully, but these errors were encountered: