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

Support mypy@1.8.0 #139

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions pytest_mypy_plugins/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ def run_mypy_typechecking(cmd_options: List[str], stdout: TextIO, stderr: TextIO

error_messages = []

# discard filename parameter '_'. Mypy uses it to generate
# one junit-xml test entry per file with failures (--junit-format per_file)
# and we don't support mypy's --junit-xml option in the first place.
def flush_errors(_: str | None, new_messages: List[str], serious: bool) -> None:
# Different mypy versions have different arity of `flush_errors`: 2 and 3 params
def flush_errors(*args: Any) -> None:
new_messages: List[str]
serious: bool
*_, new_messages, serious = args
error_messages.extend(new_messages)
f = stderr if serious else stdout
try:
Expand Down