From c707165212aab9f71709a30a87827ea81baf8739 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Mon, 13 Jul 2026 16:51:08 -0400 Subject: [PATCH] test(windows): capture only the bootstrap _run_bash, not the failure probe init_session now fires a follow-up non-login `bash -c true` probe when the login bootstrap fails, so the two bootstrap-script assertions must capture the first call only (setdefault), not the probe that overwrote it. --- tests/tools/test_base_environment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tools/test_base_environment.py b/tests/tools/test_base_environment.py index 44ff55859..9b962b206 100644 --- a/tests/tools/test_base_environment.py +++ b/tests/tools/test_base_environment.py @@ -161,8 +161,8 @@ class TestAtomicSnapshotWrite: captured = {} def fake_run_bash(cmd_string, *, login=False, timeout=120, stdin_data=None): - captured["cmd"] = cmd_string - raise RuntimeError("stop after capture") # we only need the script + captured.setdefault("cmd", cmd_string) # only the bootstrap; ignore the failure-path probe + raise RuntimeError("stop after capture") env._run_bash = fake_run_bash # type: ignore[assignment] try: @@ -188,7 +188,7 @@ class TestAtomicSnapshotWrite: captured = {} def fake_run_bash(cmd_string, *, login=False, timeout=120, stdin_data=None): - captured["cmd"] = cmd_string + captured.setdefault("cmd", cmd_string) # only the bootstrap; ignore the failure-path probe raise RuntimeError("stop after capture") env._run_bash = fake_run_bash # type: ignore[assignment]