test(windows): capture bootstrap only in msys wrap-command tests

Same fix as the base-env bootstrap tests: init_session's post-failure
non-login probe was overwriting captured["script"] with `true`. Capture
the first (bootstrap) _run_bash call via setdefault.
This commit is contained in:
Brooklyn Nicholson 2026-07-13 17:02:57 -04:00
parent c707165212
commit f0d22e4b6c

View file

@ -353,7 +353,7 @@ class TestWrapCommandWindowsNativeCwd:
captured = {}
def fake_run_bash(self, cmd_string, *, login=False, timeout=120, stdin_data=None):
captured["script"] = cmd_string
captured.setdefault("script", cmd_string) # bootstrap only; ignore the failure-path probe
raise RuntimeError("stop after capturing bootstrap")
monkeypatch.setattr(LocalEnvironment, "_run_bash", fake_run_bash)
@ -373,7 +373,7 @@ class TestWrapCommandWindowsNativeCwd:
captured = {}
def fake_run_bash(self, cmd_string, *, login=False, timeout=120, stdin_data=None):
captured["script"] = cmd_string
captured.setdefault("script", cmd_string) # bootstrap only; ignore the failure-path probe
raise RuntimeError("stop after capturing bootstrap")
monkeypatch.setattr(LocalEnvironment, "_run_bash", fake_run_bash)
@ -402,7 +402,7 @@ class TestWrapCommandWindowsNativeCwd:
captured = {}
def fake_run_bash(self, cmd_string, *, login=False, timeout=120, stdin_data=None):
captured["script"] = cmd_string
captured.setdefault("script", cmd_string) # bootstrap only; ignore the failure-path probe
raise RuntimeError("stop after capturing bootstrap")
monkeypatch.setattr(LocalEnvironment, "_run_bash", fake_run_bash)