From 3dd608cffccc52dea75d6676e1a2cb105b084e7c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 26 Aug 2026 14:23:16 -0500 Subject: [PATCH] Use a drive-qualified basedir in the test on Windows --- tests/unit_tests/build_helpers/test_ccache.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/build_helpers/test_ccache.py b/tests/unit_tests/build_helpers/test_ccache.py index a1ff40435e..d50f80cc28 100644 --- a/tests/unit_tests/build_helpers/test_ccache.py +++ b/tests/unit_tests/build_helpers/test_ccache.py @@ -125,8 +125,10 @@ def test_parse_enable_env_spelling_tables( def test_effective_ccache_basedir_prefers_user_value(tmp_path: Path) -> None: CORE.build_path = tmp_path - with patch.dict(os.environ, {"CCACHE_BASEDIR": "/custom/base"}, clear=True): - assert ccache.effective_ccache_basedir() == "/custom/base" + # Drive-qualified on Windows: "/custom/base" is not absolute there + base = "C:\\custom\\base" if os.name == "nt" else "/custom/base" + with patch.dict(os.environ, {"CCACHE_BASEDIR": base}, clear=True): + assert ccache.effective_ccache_basedir() == base with patch.dict(os.environ, {}, clear=True): assert ccache.effective_ccache_basedir() == str(tmp_path.resolve()) # Degenerate values would strip substrings ccache never rewrites