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

pyright error: Argument missing for parameter on parametrize #270

Closed
BorjaEst opened this issue Apr 14, 2022 · 7 comments · Fixed by #271
Closed

pyright error: Argument missing for parameter on parametrize #270

BorjaEst opened this issue Apr 14, 2022 · 7 comments · Fixed by #271

Comments

@BorjaEst
Copy link

I am getting the following error when I use pyright to check typing parametrize function:

error: Argument missing for parameter "host_class_or_module" (reportGeneralTypeIssues)
error: Argument missing for parameter "fixtures_dest" (reportGeneralTypeIssues)

This errror is related to my piece of code:

from pytest_cases import parametrize
class Authorized:
    @parametrize("path", example_paths)  # <----- here comes the error
    def case_ValidToken(self, path):
        return path, {"Authorization": f"Bearer something"}
@smarie
Copy link
Owner

smarie commented May 7, 2022

Thanks @BorjaEst ! I'll have a look

@smarie
Copy link
Owner

smarie commented May 7, 2022

I created a PR that should hopefully fix this. Can you please confirm that it does the trick for you ? Indeed we do not have tests for static type hints verification yet

Note: adding tests to cover this could be nice. Yet, it seems quite complex, there is an example in smarie/python-decopatch#27

@BorjaEst
Copy link
Author

BorjaEst commented May 9, 2022

Thanks @smarie, I confirm that for my cases (and so the above) the PR fix the issue.

@smarie
Copy link
Owner

smarie commented May 10, 2022

Super, thanks @BorjaEst ! I'll ship a release asap

smarie added a commit that referenced this issue May 10, 2022
Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
@smarie
Copy link
Owner

smarie commented May 12, 2022

It should be fixed in 3.6.12, available in a few minutes. Let me know if this works for you !

@BorjaEst
Copy link
Author

Yes, it works. Thanks @smarie .

@smarie
Copy link
Owner

smarie commented May 20, 2022

Thanks for the feedback @BorjaEst !

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 a pull request may close this issue.

2 participants