fix: resolve 15 Windows test failures across 8 test files#193
Open
Nyquist24 wants to merge 1 commit intoaiming-lab:mainfrom
Open
fix: resolve 15 Windows test failures across 8 test files#193Nyquist24 wants to merge 1 commit intoaiming-lab:mainfrom
Nyquist24 wants to merge 1 commit intoaiming-lab:mainfrom
Conversation
Several tests fail on Windows due to platform-specific assumptions: - **UTF-8 encoding (9 tests):** `.read_text()` and `.open()` without explicit encoding default to the system locale (GBK, Shift-JIS, etc.) on non-UTF-8 Windows systems, causing UnicodeDecodeError. Explicitly pass `encoding="utf-8"` to match the encoding used when writing. - **Docker --user flag (3 tests):** `os.getuid()`/`os.getgid()` are POSIX-only. The source code already skips `--user` on Windows, so update test assertions to match this platform-aware behavior. - **Path separators (1 test):** Compare as `Path` objects instead of string literals to handle `\` vs `/` differences. - **Backslash escaping (1 test):** Use `os.path.join(r"...", ...)` for paths embedded in generated scripts to avoid `\U` unicode escapes. - **Symlinks (1 test):** Skip on Windows where creating symlinks requires admin privileges or Developer Mode. The remaining 3 failures (test_skills_library) are an upstream count mismatch (16 SKILL.md files on disk vs 19 asserted) and fail on all platforms — not addressed here.
|
Great news for Windows users! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Following up on the CI workflow added in #176, the Windows job revealed 18 test failures. This PR fixes 15 of them across 8 test files — all changes are in test code only, no production code modified.
Root causes addressed
encoding="utf-8"to.read_text()/.open()— Windows defaults to system locale (GBK, Shift-JIS, CP1252, etc.) which can't decode UTF-8 files--userflag--useron Windows (os.getuidis POSIX-only); update assertions to matchPathobjects instead of string literals (\vs/)os.path.join(r"...", ...)to avoid\Uunicode escape errorsNot addressed (upstream issue)
The remaining 3 failures (test_skills_library) are an upstream count mismatch (16 SKILL.md files on disk vs 19 asserted) and fail on all platforms — not addressed here.