test(windows): skipif POSIX-only claude-projects discovery tests (#643)#725
Merged
test(windows): skipif POSIX-only claude-projects discovery tests (#643)#725
Conversation
Cluster C of the #643 sweep — 2 tests in test_context_projects.py that exercise claude-projects directory discovery. Both depend on: 1. `/tmp` existing as a real directory. 2. The encoding scheme `-tmp` → `/tmp` (literally `name.replace("-", "/")` in `_decode_claude_project_dirname`). Both are POSIX-only by production design — the encoding scheme cannot represent Windows drive-letter paths (`C:\...`), so the discovery never yields anything on Windows even if `/tmp` happened to exist. Production returns an empty list on Windows by intention. Same skipif pattern as PR #713 / #721 / #724. Mirrors the existing `@pytest.mark.skipif(sys.platform == "win32", reason="...")` form already used at 5+ sites in `test_server_*.py`. `sys` and `pytest` were already imported (lines 13 and 16) — no new imports. macOS: 25/25 pass. Lint clean. Co-Authored-By: Claude <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Cluster C of the #643 Windows sweep — 2 tests in
test_context_projects.pyexercising claude-projects directory discovery. Both fail on Windows because the entire flow is POSIX-only by production design:name.replace("-", "/")in_decode_claude_project_dirname(projects.py:229) — it cannot represent Windows drive-letter paths (C:\...)./tmpexisting as a real directory; production filters viaPath.is_dir()and Windows has no/tmp.Production returns an empty discovery list on Windows by intention. The right fix is
skipif, mirroring PR #713 / #721 / #724 / Cluster G's pattern.Diff
+11 / -0— two@pytest.mark.skipif(sys.platform == "win32", reason="...")decorators with reasons that name the specific POSIX dependency.sysandpytestalready imported.Why skipif (not rewrite for Windows)
Adding Windows support to claude-projects discovery is a separate design call: the encoding scheme would need to represent
C:\Users\foo\baras a directory name, which requires changing both Claude Code's encoder and memtomem's decoder. That is well out of scope for a #643 mechanical sweep.Test plan
uv run pytest packages/memtomem/tests/test_context_projects.py— 25/25 pass (skipif inactive).ruff check+ruff format --checkclean.Out of scope
Remaining: A (9 — dirty state, production change likely), E (1 — tilde expansion), H (2 — misc). Cluster B (9, memory_dir prefix) intentionally skipped — parallel work in flight on
fix/647-windows-memory-dir-prefix/fix/720-source-filter-windows.🤖 Generated with Claude Code