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

Enhancement: register_fixture return type should be properly type-hinted #579

Closed
giulioindev opened this issue Aug 16, 2024 · 2 comments · Fixed by #581
Closed

Enhancement: register_fixture return type should be properly type-hinted #579

giulioindev opened this issue Aug 16, 2024 · 2 comments · Fixed by #581

Comments

@giulioindev
Copy link
Contributor

giulioindev commented Aug 16, 2024

The current return type of the register_fixture function is Any, shouldn't be better using a TypeVar in order get a proper type hint?


Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@guacs
Copy link
Member

guacs commented Aug 17, 2024

Sounds good to me! PRs would be appreciated :)

@giulioindev
Copy link
Contributor Author

Shouldn't it be better to use the pattern suggested by pytest docs instead of using the register_fixture decorator? Managing the type hints properly causes some tests to fail since the decorator never returns the factory type but only callables.

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