test: make XDG cache-dir test portable on Windows#149
Open
hannibal-lee wants to merge 1 commit into
Open
Conversation
Constraint: Windows does not treat /tmp/custom-cache as an absolute path. Rejected: Change cache runtime behavior | native absolute-path validation is correct. Confidence: high Scope-risk: narrow Directive: Keep test filesystem paths platform-native. Tested: git diff --check; python3 -m py_compile tests/test_utils.py; targeted cache-path assertion with a local click stub. Not-tested: Full pytest suite; uv, pytest, and project dependencies are unavailable locally.
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.
Closes #148
What
Replace the hard-coded POSIX cache path in
test_cache_dir_respects_xdg_cache_homewith pytest's platform-native
tmp_pathfixture.Why
/tmp/custom-cacheis not an absolute path on Windows. The test thereforeexpected an XDG cache path while
_cache_dir()correctly fell back to thedefault Windows cache location.
Testing
uv run pytest) not run locally:uv, pytest, and project dependencies are unavailable.git diff --checkpython3 -m py_compile tests/test_utils.pyNotes
This changes test portability only; runtime cache behavior is unchanged.