From 065808c2c881f7d27b41055620f043ebb9dc7e59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 22:32:29 +0000 Subject: [PATCH 1/3] Initial plan From 0188eba3e3a5f94465b4186621eb993ba119470d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Feb 2026 22:47:28 +0000 Subject: [PATCH 2/3] Fix regression: only apply cache isolation in parallel (xdist) mode Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> --- tests/conftest.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d138449e..697b4ff1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -104,10 +104,14 @@ def isolated_cache_directory(tmp_path, monkeypatch, request, worker_id): This is especially important for pickle and maxage tests when running in parallel. Each pytest-xdist worker gets its own cache directory to avoid conflicts. + Only applies when running in parallel mode (pytest-xdist), to avoid breaking tests that use module-level path + constants computed from the default cache directory at import time. + """ - if "pickle" in request.node.keywords or "maxage" in request.node.keywords: - # Create a unique cache directory for this test - cache_dir = tmp_path / "cachier_cache" if worker_id == "master" else tmp_path / f"cachier_cache_{worker_id}" + if worker_id != "master" and ( + "pickle" in request.node.keywords or "maxage" in request.node.keywords + ): + cache_dir = tmp_path / f"cachier_cache_{worker_id}" cache_dir.mkdir(exist_ok=True, parents=True) From 12ac8e6de9addbc5340b36a166e2ff6e99a568b9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 1 Mar 2026 08:50:50 +0000 Subject: [PATCH 3/3] Apply ruff format to conftest.py to fix pre-commit.ci formatting error Co-authored-by: shaypal5 <917954+shaypal5@users.noreply.github.com> --- tests/conftest.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 697b4ff1..e2657784 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -108,9 +108,7 @@ def isolated_cache_directory(tmp_path, monkeypatch, request, worker_id): constants computed from the default cache directory at import time. """ - if worker_id != "master" and ( - "pickle" in request.node.keywords or "maxage" in request.node.keywords - ): + if worker_id != "master" and ("pickle" in request.node.keywords or "maxage" in request.node.keywords): cache_dir = tmp_path / f"cachier_cache_{worker_id}" cache_dir.mkdir(exist_ok=True, parents=True)