-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
TYP/TST: tests/mypy complaints failing locally #52423
Conversation
xsl_obj: BytesIO | StringIO | ||
# note: By default the bodies of untyped functions are not checked, | ||
# consider using --check-untyped-defs | ||
xsl_obj: BytesIO | StringIO # type: ignore[annotation-unchecked] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_stylesheet_io(datapath, mode) -> None:
for mypy to check this function and not emit this note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works for test_dirname_mixin, for the others produces error: Untyped decorator makes function "test_stylesheet_io" untyped [misc]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether the following is worth it: could lie about skip_if_no
def skip_if_no(package: str, min_version: str | None = None): -> Callable[[F], F]: ...
A simpler version could just be to remove those xsl_obj: BytesIO | StringIO
lines - they are not used by mypy/pyright anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully this can be handled correctly upstream pytest-dev/pytest#7469
Thanks @jbrockmendel (can follow up with the other typings maybe if it makes things simpler) |
This un-xfails-on-mac a test that is passing locally. Also suppresses some mypy complaints. I'm still complaints:
that I haven't found a solution for