Cover the mutation sites the report left uncovered.

A file outside the project root is not source. That branch returned
false with no test, so the mutant was uncovered. check=False now sits
on the git call coverage records, and a failing git is still reported
as GitStatusError.

Proved by test_a_file_outside_the_project_root_is_not_source. mutator
on cli.py killed 64 of 64, with nothing survived and nothing uncovered.

Co-authored-by: Robert C. Martin <[email protected]>
This commit is contained in:
Cursor Agent
2026-11-25 23:57:02 +00:00
co-authored by Robert C. Martin
parent bc42b347c5
commit 4cef42357f
2 changed files with 10 additions and 6 deletions
+8
View File
@@ -332,6 +332,14 @@ def test_changed_source_skips_unknown_and_test_files(tmp_path):
assert _tracked_source(tmp_path / "target" / "app.py") is False
def test_a_file_outside_the_project_root_is_not_source(tmp_path):
outside = tmp_path / "outside.py"
outside.write_text("x = 1\n", encoding="utf-8")
root = tmp_path / "project"
root.mkdir()
assert _tracked_source(outside, root) is False
def test_test_files_and_skipped_directories_are_left_out(tmp_path):
write_source(tmp_path, "src/app.py", "x = 1\n")
write_source(tmp_path, "src/foo_test.py", "x = 1\n")