Skip to content

Commit bdff7ec

Browse files
committed
fix(blame): Support Python 3.7 in the test suite
Apparently the public attributes of a `MagicMock` changed between 3.7 and 3.8, which was causing the unit test for `rev_opts` to fail. The unit test has been improved to use more stable APIs so that it can pass in all versions of Python supported by GitPython.
1 parent c0225b3 commit bdff7ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_repo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,8 @@ def test_blame_complex_revision(self, git):
557557
def test_blame_accepts_rev_opts(self, git):
558558
res = self.rorepo.blame("HEAD", "README.md", rev_opts=["-M", "-C", "-C"])
559559
expected_args = ['blame', 'HEAD', '-M', '-C', '-C', '--', 'README.md']
560-
for idx, arg in enumerate(expected_args):
561-
self.assertEqual(git.call_args.args[idx], arg)
560+
boilerplate_kwargs = {"p" : True, "stdout_as_string": False}
561+
git.assert_called_once_with(*expected_args, **boilerplate_kwargs)
562562

563563
@skipIf(
564564
HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),

0 commit comments

Comments
 (0)