@@ -306,16 +306,23 @@ def test_cmd_override(self):
306306 ):
307307self .assertRaises (GitCommandNotFound ,self .git .version )
308308
309- def test_refresh_bad_git_path (self ):
310- path = "yada"
311- escaped_abspath = re .escape (str (Path (path ).absolute ()))
312- expected_pattern = rf"\n[ \t]*cmdline:{ escaped_abspath } \Z"
309+ def test_refresh_bad_absolute_git_path (self ):
310+ absolute_path = str (Path ("yada" ).absolute ())
311+ expected_pattern = rf"\n[ \t]*cmdline:{ re .escape (absolute_path )} \Z"
313312with self .assertRaisesRegex (GitCommandNotFound ,expected_pattern ):
314- refresh (path )
313+ refresh (absolute_path )
315314
316- def test_refresh_good_git_path (self ):
317- path = shutil .which ("git" )
318- refresh (path )
315+ def test_refresh_bad_relative_git_path (self ):
316+ relative_path = "yada"
317+ absolute_path = str (Path (relative_path ).absolute ())
318+ expected_pattern = rf"\n[ \t]*cmdline:{ re .escape (absolute_path )} \Z"
319+ with self .assertRaisesRegex (GitCommandNotFound ,expected_pattern ):
320+ refresh (relative_path )
321+
322+ def test_refresh_good_absolute_git_path (self ):
323+ absolute_path = shutil .which ("git" )
324+ refresh (absolute_path )
325+ self .assertEqual (self .git .GIT_PYTHON_GIT_EXECUTABLE ,absolute_path )
319326
320327def test_options_are_passed_to_git (self ):
321328# This works because any command after git --version is ignored.