def test_initial_refresh_from_bad_git_path_env_error(self, case):
        """In "e" mode, bad initial path raises an exception."""
        (mode,) = case
        env_vars = {
            "GIT_PYTHON_GIT_EXECUTABLE": str(Path("yada").absolute()),  # Any bad path.
            "GIT_PYTHON_REFRESH": mode,
        }
        with _rollback_refresh():
            Git.GIT_PYTHON_GIT_EXECUTABLE = None  # Simulate startup.

            with mock.patch.dict(os.environ, env_vars):
                with self.assertRaisesRegex(ImportError, r"\ABad git executable.\n"):
                    refresh()
In "e" mode, bad initial path raises an exception.
test/test_git.py