Skip to content

test(windows): skipif POSIX-only pwd.getpwuid simulation in fastembed_cache (#643)#721

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

test(windows): skipif POSIX-only pwd.getpwuid simulation in fastembed_cache (#643)#721
memtomem merged 1 commit intomainfrom
test/win-pwd-skipif

Conversation

@memtomem
Copy link
Copy Markdown
Owner

@memtomem memtomem commented May 2, 2026

Summary

Diff

+6 / -0 — adds import sys (file didn't use it) and the skipif decorator with a reason that names the specific POSIX dependency.

Test plan

  • macOS: uv run pytest packages/memtomem/tests/test_fastembed_cache.py — 6/6 pass (skipif inactive on POSIX, original test still runs).
  • Lint: ruff check + ruff format --check clean.
  • Windows CI: this test will skip rather than ImportError.

Out of scope

The other 27 Windows failures from the previous run cluster into ~7 separate root causes (dirty-state misclassification, memory_dir prefix matching, claude-projects scope, mm.exe binary path, tilde expansion, init_cmd POSIX assumptions, misc) — each will get its own PR per feedback_one_change_per_pr.md. Cluster B (memory_dir prefix) is intentionally skipped here as parallel work is in flight on fix/647-windows-memory-dir-prefix.

🤖 Generated with Claude Code

…_cache (#643)

`test_unexpandable_home_raises_actionable_error` simulates the POSIX-
specific failure mode where `$HOME` is unset AND `pwd.getpwuid()` raises
`KeyError`, causing `Path.expanduser()` to fail with `RuntimeError`. The
test imports `pwd` and monkeypatches `pwd.getpwuid` — both POSIX-only.

On Windows there is no `pwd` module; expanduser uses USERPROFILE /
HOMEDRIVE+HOMEPATH instead of pwent, so the failure mode under test does
not exist on Windows. Mirrors PR #713's pattern for POSIX-only assertions.

Same `@pytest.mark.skipif(sys.platform == "win32", ...)` form already used
across `test_server_*.py` (5 sites). Adds one stdlib import (`sys`) since
the file did not already use it.

Co-Authored-By: Claude <[email protected]>
@memtomem memtomem merged commit 7aab625 into main May 2, 2026
8 of 9 checks passed
@memtomem memtomem deleted the test/win-pwd-skipif branch May 2, 2026 07:27
@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