Skip to content

test: make XDG cache-dir test portable on Windows#149

Open
hannibal-lee wants to merge 1 commit into
Andyyyy64:mainfrom
hannibal-lee:fix/windows-cache-test
Open

test: make XDG cache-dir test portable on Windows#149
hannibal-lee wants to merge 1 commit into
Andyyyy64:mainfrom
hannibal-lee:fix/windows-cache-test

Conversation

@hannibal-lee

Copy link
Copy Markdown
Contributor

Closes #148

What

Replace the hard-coded POSIX cache path in test_cache_dir_respects_xdg_cache_home
with pytest's platform-native tmp_path fixture.

Why

/tmp/custom-cache is not an absolute path on Windows. The test therefore
expected an XDG cache path while _cache_dir() correctly fell back to the
default Windows cache location.

Testing

  • Full test suite (uv run pytest) not run locally: uv, pytest, and project dependencies are unavailable.
  • git diff --check
  • python3 -m py_compile tests/test_utils.py
  • Targeted cache-path assertion with a platform-native absolute path

Notes

This changes test portability only; runtime cache behavior is unchanged.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a pytest error (field test)

1 participant