From a2186deade6e2ff1f1829d881737700bbd9733e5 Mon Sep 17 00:00:00 2001 From: marzouca <306379478+marzouca@users.noreply.github.com> Date: Sat, 31 Oct 2026 03:06:33 -0500 Subject: [PATCH] test: detect unavailable WSL bash launchers Assisted-by: OpenAI Codex --- tests/test_install.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_install.py b/tests/test_install.py index a80e439..84dff92 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -29,8 +29,13 @@ def test_install_sh_is_lf_and_parses(self): if bash is None: self.skipTest("bash is not on PATH") result = subprocess.run([bash, "-n", "install.sh"], cwd=ROOT, capture_output=True, text=True) - if result.returncode != 0 and "distribution" in (result.stdout + result.stderr).lower(): - self.skipTest("bash on PATH is an empty WSL launcher") + diagnostic = (result.stdout + result.stderr).lower() + empty_wsl = "distribution" in diagnostic or ( + "wsl" in diagnostic and "execvpe(/bin/bash) failed" in diagnostic and + "no such file or directory" in diagnostic + ) + if result.returncode != 0 and empty_wsl: + self.skipTest("bash on PATH is a WSL launcher with no usable Linux shell") self.assertEqual(result.returncode, 0, result.stderr) @unittest.skipUnless(WINDOWS, "install.cmd is Windows only")