skip install related tests if git is missing (#10809)

This commit is contained in:
skshetry
2025-07-21 14:11:15 +05:45
committed by GitHub
parent 1f5bace250
commit 397f4c6f28
+3 -2
View File
@@ -4,12 +4,13 @@ import sys
import pytest
from dulwich.porcelain import remote_add as git_remote_add
from git import GitCommandError
from dvc.exceptions import DvcException
from dvc_data.hashfile.hash import file_md5
from tests.func.parsing.test_errors import escape_ansi
git = pytest.importorskip("git")
@pytest.mark.skipif(
sys.platform == "win32", reason="Git hooks aren't supported on Windows"
@@ -55,7 +56,7 @@ class TestInstall:
dvc.install()
# scm.commit bypasses hooks
with pytest.raises(GitCommandError, match=r"modified:\s*file"):
with pytest.raises(git.GitCommandError, match=r"modified:\s*file"):
scm.gitpython.repo.git.commit(m="file modified")
def test_post_checkout(self, tmp_dir, scm, dvc):