From 6bdc4c02314acf76e5e4949d3d385afe555e48c9 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 7 Jun 2026 18:21:03 -0700 Subject: [PATCH] test: skip curses tests on Windows where _curses is unavailable (#40611) Salvaged from #40447; re-verified on main, tightened, tested. Co-authored-by: Ganesh0690 --- tests/hermes_cli/test_curses_arrow_keys.py | 7 +++++++ tests/hermes_cli/test_curses_color_compat.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/hermes_cli/test_curses_arrow_keys.py b/tests/hermes_cli/test_curses_arrow_keys.py index c1bafbd8c3d..8fe60b7410c 100644 --- a/tests/hermes_cli/test_curses_arrow_keys.py +++ b/tests/hermes_cli/test_curses_arrow_keys.py @@ -7,6 +7,13 @@ used to treat the leading ``27`` as ESC/cancel, which dumped the setup wizard's provider/model picker into its numbered "Select [1-N]" fallback the instant a user pressed up or down. """ +import sys + +import pytest + +# curses (and its _curses C extension) is Unix-only; skip the whole module on Windows. +if sys.platform == "win32": + pytest.skip("curses is not available on Windows", allow_module_level=True) import curses from hermes_cli.curses_ui import ( diff --git a/tests/hermes_cli/test_curses_color_compat.py b/tests/hermes_cli/test_curses_color_compat.py index 2416ded1230..5b9ed954ea7 100644 --- a/tests/hermes_cli/test_curses_color_compat.py +++ b/tests/hermes_cli/test_curses_color_compat.py @@ -8,6 +8,13 @@ The bug was ``curses.init_pair(4, 8, -1)`` using raw color 8 ("bright black" / dim gray) which does not exist on 8-color terminals. The fix clamps with ``min(8, curses.COLORS - 1)``. """ +import sys + +import pytest + +# curses (and its _curses C extension) is Unix-only; skip the whole module on Windows. +if sys.platform == "win32": + pytest.skip("curses is not available on Windows", allow_module_level=True) import curses import re