Repository navigation
Conversation
The type check command exit status was ignored. A fatal mypy run, for example with an unknown flag, exits with status 2 and prints nothing to stdout, so mutmut treated it as an empty report and ran without a type check. Raise on any status other than 0 or 1, and on status 1 with no report. Keep status 1 with a note-only report as an empty result, since mypy uses that for notes. Fixes boxed#667.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run_type_checker()ignored the exit status of the type check command. A mypyrun that fails before printing a report, for example with an unknown flag or a
plugin import error, exits with status 2 and an empty stdout. That was parsed as
an empty report, so mutmut continued as if there were no type errors.
Raise when the command exits with a status other than 0 or 1, and when it exits
with 1 but prints no report. Status 1 with a note-only report still returns an
empty list, because mypy uses that for notes such as
annotation-unchecked.Fixes #667.
Testing:
uv run pytest: 666 passed, 6 skipped.uv run pre-commit run --files src/mutmut/type_checking.py tests/test_type_checking.py: passes.mutmut runwith an invalid mypy flag now exits 1 and shows the mypy stderr; a valid run still reportscaught by type check.Note:
maincurrently fails the pre-commit mypy hook onscripts/benchmark_type_check_filter.py(upstream runs 46880503657 and46881125492). This PR does not touch that file.