1212import pathlib
1313import pickle
1414import tempfile
15- from unittest import skipIf , SkipTest
15+ from unittest import mock , skipIf , SkipTest
1616
1717from git import (
1818 InvalidGitRepositoryError ,
3737)
3838from git .repo .fun import touch
3939from git .test .lib import (
40- patch ,
4140 TestBase ,
4241 with_rw_repo ,
4342 fixture
@@ -393,7 +392,7 @@ def test_archive(self):
393392 assert stream .tell ()
394393 os .remove (tmpfile )
395394
396- @patch .object (Git , '_call_process' )
395+ @mock . patch .object (Git , '_call_process' )
397396 def test_should_display_blame_information (self , git ):
398397 git .return_value = fixture ('blame' )
399398 b = self .rorepo .blame ('master' , 'lib/git.py' )
@@ -437,7 +436,7 @@ def test_blame_real(self):
437436 assert c , "Should have executed at least one blame command"
438437 assert nml , "There should at least be one blame commit that contains multiple lines"
439438
440- @patch .object (Git , '_call_process' )
439+ @mock . patch .object (Git , '_call_process' )
441440 def test_blame_incremental (self , git ):
442441 # loop over two fixtures, create a test fixture for 2.11.1+ syntax
443442 for git_fixture in ('blame_incremental' , 'blame_incremental_2.11.1_plus' ):
@@ -460,7 +459,7 @@ def test_blame_incremental(self, git):
460459 orig_ranges = flatten ([entry .orig_linenos for entry in blame_output ])
461460 self .assertEqual (orig_ranges , flatten ([range (2 , 3 ), range (14 , 15 ), range (1 , 2 ), range (2 , 13 ), range (13 , 15 )])) # noqa E501
462461
463- @patch .object (Git , '_call_process' )
462+ @mock . patch .object (Git , '_call_process' )
464463 def test_blame_complex_revision (self , git ):
465464 git .return_value = fixture ('blame_complex_revision' )
466465 res = self .rorepo .blame ("HEAD~10..HEAD" , "README.md" )
0 commit comments