mirror of
https://github.com/esphome/esphome.git
synced 2026-09-09 06:18:46 +00:00
Use a drive-qualified basedir in the test on Windows
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user