Skip to content

Commit

Permalink
Add an unrelated test that was missing for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim committed Oct 13, 2023
1 parent 926f6ce commit b45ecb9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/unit/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,16 @@ def test_parse_diff_output(git):
pathlib.Path("README.md"): [1, 3, 4, 5, 6],
pathlib.Path("foo.txt"): [1],
}


def test_parse_diff_output__error(git):
diff = """
@@ -0,0 +1,1 @@
+name: Python Coverage Comment
diff --git a/README.md b/README.md
index 1f1d9a4..e69de29 100644
"""
git.register("git fetch origin main --depth=1000")()
git.register("git diff --unified=0 FETCH_HEAD -- .")(stdout=diff)
with pytest.raises(ValueError):
coverage.parse_diff_output(diff=diff)

0 comments on commit b45ecb9

Please sign in to comment.