Conversation
#643) The 8 tests in `test_wiki_cmd_override.py` asserted forward-slash literals against output that contains platform-native separators on Windows, causing failures on the Windows CI job for the #643 sweep. Mirrors PR #711 (commit b04dcdb) — production code is correct as-is, only test assertions need to bridge the separator gap. `wiki_cmd.py` is unmodified: `click.edit(filename=str(result.path))` (line 87) intentionally hands the editor a platform-native path (Windows users want notepad.exe to receive `C:\...\overrides\claude.md`, not a POSIX path), same trade-off as PR #711's `norm_path()`. Two patterns: - 3 `endswith` on `captured[0]` (the filename passed to click.edit) → wrap LHS in `Path(...).as_posix()` (direct PR #711 mirror). - 5 `Seeded ...` substring on `result.output` → substring "in" can't as_posix() a path embedded inside a multi-line blob, so normalize `result.output.replace("\\\\", "/")` instead. For the 3 stdout-contract tests this is a one-time per-test normalization at the top, with the adjacent `str(target_path) in out` assertion flipped to `target_path.as_posix() in out` to stay symmetric (otherwise the trap: LHS keeps `\\`, RHS now has `/`, silent break on Windows). POSIX behavior: replace is a no-op (verified locally — 32/32 pass on macOS), so existing CI stays green. 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
/vs\\) #643 sweep continues. 8 tests intest_wiki_cmd_override.pyfailed on Windows because they asserted forward-slash literals against output that contained platform-native separators (\).What's NOT changed
wiki_cmd.pyis untouched.click.edit(filename=str(result.path))(line 87) intentionally hands the editor a platform-native path — Windows users wantnotepad.exeto receiveC:\...\overrides\claude.md, not a POSIX path. Same trade-off as PR #711'snorm_path().The 8 sites
test_wiki_skill_override_invokes_editortest_wiki_skill_override_stdout_contracttest_wiki_agent_override_warns_on_dropped_fieldstest_wiki_agent_override_invokes_editortest_wiki_agent_override_stdout_contracttest_wiki_command_override_warns_on_dropped_fieldstest_wiki_command_override_invokes_editortest_wiki_command_override_stdout_contractPattern A —
endswithoncaptured[0](3 sites)Direct PR #711 mirror: wrap LHS in
Path(...).as_posix().Pattern B —
Seeded ...substring onresult.output(5 sites)Substring "in" check can't
as_posix()a path embedded inside a multi-line blob. Normalizeresult.output.replace("\\", "/")instead. For the 3 stdout-contract tests, normalizeoutonce at the top and flip the adjacentstr(target_path) in outtotarget_path.as_posix() in outto stay symmetric (otherwise: LHS keeps\, RHS now/, silent break on Windows).Test plan
uv run pytest packages/memtomem/tests/test_wiki_cmd_override.py— 32/32 pass.ruff check+ruff format --checkclean./vs\\) #643 should turn green for these 8 tests.Out of scope
wiki_cmd.pyline 71 (Seeded {rel}) and line 75 (git add ...) emit different separators on the same screen on Windows (cosmetic UX inconsistency). Could be a separate one-line PR ({rel.as_posix()}); deliberately not bundled here to keep the sweep mechanically test-only.🤖 Generated with Claude Code