test(hooks): skip bash subprocess validator test on Windows

`bash` on the Windows CI runner resolves to `wsl.exe` which fails with
"Windows Subsystem for Linux has no installed distributions." The shell
hooks themselves are POSIX-only — Windows users use the Python entry
point — so the bash-subprocess exercise is non-applicable on win32.

The static-grep validator tests still run on every platform, so the
shell-side validation is still asserted under Windows; only the live
bash invocation is skipped.
This commit is contained in:
Igor Lins e Silva
2026-04-27 02:45:04 -03:00
parent fe56797762
commit 3deebfed19
+7
View File
@@ -9,6 +9,9 @@ Written BEFORE the fix.
"""
import os
import sys
import pytest
class TestSaveHookAutoMines:
@@ -94,6 +97,10 @@ class TestShellHookTranscriptValidation:
'is_valid_transcript_path "$TRANSCRIPT_PATH"' in src
), "validator must be invoked against TRANSCRIPT_PATH before mining"
@pytest.mark.skipif(
sys.platform == "win32",
reason="shell hooks are POSIX-only; Windows CI bash maps to wsl.exe with no distro",
)
def test_validators_run_via_bash(self, tmp_path):
"""Source the validator out of each hook and exercise it directly."""
import subprocess