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

Type hint for FlaskCliRunner.invoke is not specific #5645

Open
loewexy opened this issue Nov 19, 2024 · 1 comment
Open

Type hint for FlaskCliRunner.invoke is not specific #5645

loewexy opened this issue Nov 19, 2024 · 1 comment
Labels

Comments

@loewexy
Copy link

loewexy commented Nov 19, 2024

The type hint of the return type of FlaskCliRunner.invoke ist typing.Any but should use click.testing.Result. This leads to missing auto completions in the IDE as well as errors from the type checker if not additional type narrowing is done.

The Problem is here: https://github.com/pallets/flask/blob/main/src/flask/testing.py#L276

To fix this Result must be imported from click.testing and used as a return type annotation.

The documentation already specifies click.testing.Result as return type.

Environment:

  • Python version: 3.12.2
  • Flask version: 3.1.0 but is also present in current main branch.
@iitzIrFan
Copy link

iitzIrFan commented Nov 21, 2024

@davidism @pgjones @tachyondecay @carc1n0gen @ThiefMaster @jab @greyli Can I work on this issue as I had been working for it for quite a while and think I got lead to the solution for this issue you wanted !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants