From 692728996f199b74f25d77ad03074dc9f407a87c Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 19 Feb 2026 22:23:53 +0100 Subject: [PATCH 1/2] Use different codes for special keys on Windows --- tests/utils.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 76616b4..efb3435 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,14 +1,15 @@ import base64 import json import os +import sys from collections.abc import Generator from contextlib import contextmanager from pathlib import Path -from typing import Any, Union +from typing import Any @contextmanager -def changing_dir(directory: Union[str, Path]) -> Generator[None, None, None]: +def changing_dir(directory: str | Path) -> Generator[None, None, None]: initial_dir = os.getcwd() os.chdir(directory) try: @@ -22,13 +23,25 @@ def build_logs_response(*logs: dict[str, Any]) -> str: return "\n".join(json.dumps(log) for log in logs) -class Keys: - RIGHT_ARROW = "\x1b[C" - DOWN_ARROW = "\x1b[B" - ENTER = "\r" - CTRL_C = "\x03" - TAB = "\t" - BACKSPACE = "\x7f" +if sys.platform == "win32": + + class Keys: + RIGHT_ARROW = "\xe0M" + DOWN_ARROW = "\xe0P" + ENTER = "\r" + CTRL_C = "\x03" + TAB = "\t" + BACKSPACE = "\x08" + +else: + + class Keys: + RIGHT_ARROW = "\x1b[C" + DOWN_ARROW = "\x1b[B" + ENTER = "\r" + CTRL_C = "\x03" + TAB = "\t" + BACKSPACE = "\x7f" def create_jwt_token(payload: dict[str, Any]) -> str: From c7d9ab00924256bc2903ac518a68d8c29c9087ac Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 19 Feb 2026 22:25:17 +0100 Subject: [PATCH 2/2] Add windows to test matrix --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1686d0e..bd3fc3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - os: [ ubuntu-latest, macos-latest ] + os: [ ubuntu-latest, macos-latest, windows-latest ] python-version: ["3.14"] uv-resolution: - highest @@ -37,7 +37,7 @@ jobs: os: macos-latest uv-resolution: lowest-direct - python-version: "3.12" - os: ubuntu-latest + os: windows-latest uv-resolution: highest - python-version: "3.13" os: macos-latest