Skip to content

Un-skip and fix Windows tests (#409) - #1538

Open
SAKMZ wants to merge 1 commit into
simonw:mainfrom
SAKMZ:fix/windows-tests
Open

Un-skip and fix Windows tests (#409)#1538
SAKMZ wants to merge 1 commit into
simonw:mainfrom
SAKMZ:fix/windows-tests

Conversation

@SAKMZ

@SAKMZ SAKMZ commented Jul 19, 2026

Copy link
Copy Markdown

Fixes #409.

On Windows today, many tests marked @pytest.mark.xfail(sys.platform == "win32") actually pass — the markers are stale (the test_chat ones appear to have been fixed by the addition of pyreadline3). This removes the stale markers and fixes the handful that were genuinely failing:

  • Removed 8 now-passing xfail markers in test_chat.py, test_chat_templates.py, and test_keys.py.
  • Fixed hardcoded / path separators in test_keys_in_user_path and test_logs_path by normalizing the expected paths with pathlib (correct on every platform).
  • Guarded the chmod 600 assertion in test_keys_set to non-Windows, since Windows has no POSIX file modes.
  • Removed the now-unused import sys from test_llm_logs.py.

Two fragments tests still xfail on Windows — they surface a genuine bug where drive-letter paths (C:\...) are parsed as fragment prefixes (Error: Unknown fragment prefix: C). I've updated their reason strings to document the real cause and am happy to send a follow-up PR for the underlying fix.

Verification

Run on Windows 11 / Python 3.14 for the affected files:

94 passed, 2 xfailed

black and ruff are both clean.


🤖 Generated with Claude Code

Many tests marked xfail on Windows now pass, so remove the stale markers.
Fix the ones that were genuinely failing: normalize hardcoded "/" path
separators with pathlib in test_keys_in_user_path and test_logs_path, and
guard the POSIX "chmod 600" assertion in test_keys_set to non-Windows,
which has no POSIX file modes.

Two fragments tests still xfail on Windows because of a real bug where
drive-letter paths (C:\...) are parsed as fragment prefixes; their reason
strings now document the actual cause.

Refs simonw#409

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix skipped tests on Windows

1 participant