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 account for different call variants #22

Open
3 of 4 tasks
last-partizan opened this issue Jan 29, 2022 · 3 comments
Open
3 of 4 tasks

Add type hints, to account for different call variants #22

last-partizan opened this issue Jan 29, 2022 · 3 comments

Comments

@last-partizan
Copy link
Contributor

last-partizan commented Jan 29, 2022

I'm using pytest-cases, and using @fixture without parenthesis, and it produces errors in pyright.

@fixture
def some_fixture():
    ...
Argument of type "() -> str" cannot be assigned to parameter "scope" of type "str" in function "fixture"

There is @overload in typing to handle such cases
https://mypy.readthedocs.io/en/stable/generics.html#decorator-factories

Are you interested in adding support for type hinting?

Progress:

@smarie
Copy link
Owner

smarie commented Feb 1, 2022

Thanks @last-partizan ! Sure, that would be a good addition !
Would you like to have a try ?

@last-partizan
Copy link
Contributor Author

Yes, i'll try to do it!

@last-partizan
Copy link
Contributor Author

#23

Please, take a look :)

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

No branches or pull requests

2 participants