Skip to content

Fix serial-mode regression in pickle cache file manipulation tests#357

Draft
Copilot wants to merge 2 commits intotesting-improvementsfrom
copilot/sub-pr-349-again
Draft

Fix serial-mode regression in pickle cache file manipulation tests#357
Copilot wants to merge 2 commits intotesting-improvementsfrom
copilot/sub-pr-349-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

The isolated_cache_directory autouse fixture was patching _global_params.cache_dir for all pickle/maxage tests, including serial runs. Tests like test_bad_cache_file and test_delete_cache_file use module-level path constants computed at import time:

EXPANDED_CACHIER_DIR = os.path.expanduser(_global_params.cache_dir)
_BAD_CACHE_FPATH = os.path.join(EXPANDED_CACHIER_DIR, _BAD_CACHE_FNAME)

When the fixture redirected the global cache dir to tmp_path, decorated functions wrote cache files there while the hardcoded paths still pointed to ~/.cachier/. File manipulation operations (truncate/delete) silently missed the cache files, causing the tests to always return False.

Changes

  • tests/conftest.py: Guard isolated_cache_directory with worker_id != "master" so cache dir patching only activates during parallel (xdist) execution, leaving serial test runs undisturbed.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pre-commit CI errors in testing process Fix serial-mode regression in pickle cache file manipulation tests Feb 28, 2026
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.

2 participants