Files
mtusi2026lab6/scripts/run_resilience_local.py
T

26 lines
701 B
Python

"""Run the public resilience test on Windows by executing the shell hook with Git Bash.
The public test launches the hook directly. That works on Linux. This runner does not
change tests/resilience.py; it only prefixes the same script with bash.
"""
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "tests"))
import resilience # noqa: E402
BASH = r"C:\Program Files\Git\bin\bash.exe"
_popen = resilience.subprocess.Popen
def popen(args, **kwargs):
if args and str(args[0]).endswith(".sh"):
args = [BASH, str(args[0])]
return _popen(args, **kwargs)
resilience.subprocess.Popen = popen
resilience.run(resilience.main)