test: skip curses tests on Windows where _curses is unavailable (#40611)

Salvaged from #40447; re-verified on main, tightened, tested.

Co-authored-by: Ganesh0690 <Ganesh0690@users.noreply.github.com>
This commit is contained in:
Teknium 2026-06-07 18:21:03 -07:00 committed by GitHub
parent 628780b4f3
commit 6bdc4c0231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View file

@ -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 (

View file

@ -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