◐ Shell
reader mode source ↗
Skip to content
Merged
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
40 changes: 34 additions & 6 deletions test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
InvalidGitRepositoryError,
UnmergedEntriesError,
)
from git.index.fun import hook_path
from git.index.typ import BaseIndexEntry, IndexEntry
from git.objects import Blob
from test.lib import TestBase, fixture, fixture_path, with_rw_directory, with_rw_repo
Expand Down Expand Up @@ -991,9 +991,32 @@ class Mocked:
rel = index._to_relative_path(path)
self.assertEqual(rel, os.path.relpath(path, root))

@pytest.mark.xfail(
type(_win_bash_status) is WinBashStatus.WslNoDistro,
reason="Currently uses the bash.exe for WSL even with no WSL distro installed",
raises=HookExecutionError,
)
@with_rw_repo("HEAD", bare=True)
Expand All @@ -1004,7 +1027,7 @@ def test_pre_commit_hook_success(self, rw_repo):

@pytest.mark.xfail(
type(_win_bash_status) is WinBashStatus.WslNoDistro,
reason="Currently uses the bash.exe for WSL even with no WSL distro installed",
raises=AssertionError,
)
@with_rw_repo("HEAD", bare=True)
Expand All @@ -1030,13 +1053,18 @@ def test_pre_commit_hook_fail(self, rw_repo):
raise AssertionError("Should have caught a HookExecutionError")

@pytest.mark.xfail(
type(_win_bash_status) in {WinBashStatus.Absent, WinBashStatus.Wsl},
reason="Specifically seems to fail on WSL bash (in spite of #1399)",
raises=AssertionError,
)
@pytest.mark.xfail(
type(_win_bash_status) is WinBashStatus.WslNoDistro,
reason="Currently uses the bash.exe for WSL even with no WSL distro installed",
raises=HookExecutionError,
)
@with_rw_repo("HEAD", bare=True)
Expand All @@ -1054,7 +1082,7 @@ def test_commit_msg_hook_success(self, rw_repo):

@pytest.mark.xfail(
type(_win_bash_status) is WinBashStatus.WslNoDistro,
reason="Currently uses the bash.exe for WSL even with no WSL distro installed",
raises=AssertionError,
)
@with_rw_repo("HEAD", bare=True)
Expand Down
Toggle all file notes Toggle all file annotations