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
[BUG] auth/AuthProvider type hint incorrect #1776
Labels
Status: Needs Triage
Requires initial assessment to categorize and prioritize
Type: Bug
Errors or unexpected behavior
Comments
huwcbjones
added
Status: Needs Triage
Requires initial assessment to categorize and prioritize
Type: Bug
Errors or unexpected behavior
labels
Oct 3, 2023
huwcbjones
added a commit
to huwcbjones/schemathesis
that referenced
this issue
Oct 3, 2023
huwcbjones
added a commit
to huwcbjones/schemathesis
that referenced
this issue
Oct 3, 2023
3 tasks
huwcbjones
added a commit
to huwcbjones/schemathesis
that referenced
this issue
Oct 3, 2023
Stranger6667
pushed a commit
to huwcbjones/schemathesis
that referenced
this issue
Oct 3, 2023
Stranger6667
pushed a commit
that referenced
this issue
Oct 3, 2023
Apologies, didn't quite fully fix this one. New error is now mwe.py:7:2: error: Argument 1 to "__call__" of "FilterableApplyAuth" has incompatible type "Type[Provider]"; expected "Callable[..., None]" [arg-type]
mwe.py:12:21: note: Revealed type is "builtins.dict[builtins.str, Any]"
Found 1 error in 1 file (checked 1 source file) |
huwcbjones
added a commit
to huwcbjones/schemathesis
that referenced
this issue
Oct 5, 2023
Oh, what mypy version are you using? |
Workaround is to use |
1.0.1 as it's the current version in Debian (stable) Bookworm |
Can still reproduce the above mypy error on 1.5.1 (latest as of writing) |
4 tasks
huwcbjones
added a commit
to huwcbjones/schemathesis
that referenced
this issue
Oct 5, 2023
Stranger6667
pushed a commit
that referenced
this issue
Oct 8, 2023
Stranger6667
pushed a commit
that referenced
this issue
Oct 11, 2023
Stranger6667
pushed a commit
that referenced
this issue
Oct 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status: Needs Triage
Requires initial assessment to categorize and prioritize
Type: Bug
Errors or unexpected behavior
Checklist
Describe the bug
I believe the type hint for AuthProvider is incorrect.
The definition of AuthProvider uses a TypeVar for the
data
argument toget
andset
.I think the intended behaviour was to mandate that the types passed to
get
andset
are the same for a given AuthProvider.To Reproduce
Steps to reproduce the behavior:
mypy mwe.py
Expected behavior
No mypy errors
Environment (please complete the following information):
Additional context
If I add
Generic[Auth]
to theAuthProvider
class definition, the errors go away.The text was updated successfully, but these errors were encountered: