Skip to content

Commit 2eb2d9c

Browse files
committed
Fix parse_diff tests not calling correct function
The parse_diff function was moved out of Repository in the past, but some tests weren't updated to reflect this change. So, the tests passed because they expected any exception to be raised, but they weren't actually calling the correct function (Diff.parse_diff).
1 parent 89206af commit 2eb2d9c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/test_diff.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ def test_diff_parse(barerepo):
334334
deltas = list(diff.deltas)
335335
assert 2 == len(deltas)
336336

337-
def test_parse_diff_null(barerepo):
338-
with pytest.raises(Exception):
339-
barerepo.parse_diff(None)
337+
def test_parse_diff_null():
338+
with pytest.raises(TypeError):
339+
pygit2.Diff.parse_diff(None)
340340

341-
def test_parse_diff_bad(barerepo):
341+
def test_parse_diff_bad():
342342
diff = textwrap.dedent(
343343
"""
344344
diff --git a/file1 b/file1
@@ -347,5 +347,5 @@ def test_parse_diff_bad(barerepo):
347347
@@ -1,1 +1,1 @@
348348
-Hi!
349349
""")
350-
with pytest.raises(Exception):
351-
barerepo.parse_diff(diff)
350+
with pytest.raises(pygit2.GitError):
351+
pygit2.Diff.parse_diff(diff)

0 commit comments

Comments
 (0)