Skip to content

test(windows): skipif POSIX-only claude-projects discovery tests (#643)#725

Merged
memtomem merged 1 commit intomainfrom
test/win-context-projects-skipif
May 2, 2026
Merged

test(windows): skipif POSIX-only claude-projects discovery tests (#643)#725
memtomem merged 1 commit intomainfrom
test/win-context-projects-skipif

Conversation

@memtomem
Copy link
Copy Markdown
Owner

@memtomem memtomem commented May 2, 2026

Summary

Cluster C of the #643 Windows sweep — 2 tests in test_context_projects.py exercising claude-projects directory discovery. Both fail on Windows because the entire flow is POSIX-only by production design:

  1. The encoding scheme is literally name.replace("-", "/") in _decode_claude_project_dirname (projects.py:229) — it cannot represent Windows drive-letter paths (C:\...).
  2. Both tests rely on /tmp existing as a real directory; production filters via Path.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. sys and pytest already 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\bar as 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

  • macOS: uv run pytest packages/memtomem/tests/test_context_projects.py — 25/25 pass (skipif inactive).
  • Lint: ruff check + ruff format --check clean.
  • Windows CI: 2 tests skip cleanly.

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

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]>
@memtomem memtomem merged commit f3aa292 into main May 2, 2026
8 of 9 checks passed
@memtomem memtomem deleted the test/win-context-projects-skipif branch May 2, 2026 07:43
@github-actions github-actions Bot locked and limited conversation to collaborators May 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants