-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Mypy checking fails with --disallow-untyped-decorators #7589
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
Labels
topic: typing
type-annotation issue
type: enhancement
new feature or API change, should be merged into features branch
Comments
This was referenced Jul 31, 2020
This is a mypy bug. I proposed a fix here: python/mypy#9232. I'm afraid there isn't a simple workaround for this in pytest. Hopefully the mypy fix will be merged and released, but until then I suggest turning off |
JukkaL
pushed a commit
to python/mypy
that referenced
this issue
Jul 31, 2020
… overloads (#9232) When --disallow-untyped-decorators is used, a callable-class decorator with a overloads on its __call__ implementation would incorrectly issue an "Untyped decorator makes function untyped" error, even when the overloads are typed properly. This has been reported in pytest, which does this: pytest-dev/pytest#7589. This fixes the problem by expanding on a previous fix in this area, #5509.
pmav99
added a commit
to pmav99/tbump
that referenced
this issue
Sep 3, 2020
This is due to a mypy bug. It is only needed with pytest 6+ on python 3.7 (python 3.8 works fine) and it will probably be solved in a newer mypy version More info: pytest-dev/pytest#7589
pmav99
added a commit
to pmav99/tbump
that referenced
this issue
Sep 3, 2020
This is due to a mypy bug. It is only needed with pytest 6+ on python 3.7 (python 3.8 works fine) and it will probably be solved in a newer mypy version More info: pytest-dev/pytest#7589
zackw
added a commit
to zackw/infinitestimal
that referenced
this issue
Aug 16, 2021
We need at least pytest 6.2.0, as well as a recent mypy, for the fix for the spurious “error: Untyped decorator makes function "test_xxx" untyped” diagnostic (pytest-dev/pytest#7589).
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
topic: typing
type-annotation issue
type: enhancement
new feature or API change, should be merged into features branch
It looks like the
@pytest.mark.parametrize
decorator can't pass mypy with--disallow-untyped-decorators
. mypy works without the flag.Following my comment, I made this reproduction repo. I can reproduce this with pytest 6.0.1 and Python 3.6.9 on Linux or Python 3.8.5 on Windows.
The text was updated successfully, but these errors were encountered: