test(gateway-windows): make ctypes.windll monkeypatch tolerant on non-Windows

Linux/macOS CI runners don't have ctypes.windll, so the elevated-gateway
test fails at module load. Adding raising=False lets monkeypatch install
the mock attribute without first requiring it to exist.
This commit is contained in:
teknium1 2026-05-19 11:15:19 -07:00 committed by Teknium
parent d948de39e9
commit a19eb54727

View file

@ -139,7 +139,7 @@ def test_elevated_gateway_command_uses_pythonw_hidden_console(monkeypatch):
monkeypatch.setattr(gateway_windows, "_current_profile_cli_args", lambda: ["--profile", "alice"])
monkeypatch.setattr(gateway_windows, "_derive_venv_pythonw", lambda exe: exe.replace("python.exe", "pythonw.exe"))
monkeypatch.setattr(gateway_windows.sys, "executable", r"C:\Hermes\venv\Scripts\python.exe")
monkeypatch.setattr(gateway_windows.ctypes, "windll", FakeWindll())
monkeypatch.setattr(gateway_windows.ctypes, "windll", FakeWindll(), raising=False)
assert gateway_windows._launch_elevated_gateway_command("install", ["--start-now", "--elevated-handoff"])