Patch the direct ccache probe in the usable-binary test

This commit is contained in:
J. Nick Koston
2026-08-25 14:06:32 -05:00
parent a6c4c46930
commit d3f6cbe14a
+9 -2
View File
@@ -1980,7 +1980,14 @@ def test_ccache_env_opt_in_with_usable_binary(
) -> None:
# Forced on with a runnable binary: no warning, full env exported.
p1, p2, p3 = _ccache_patches(tmp_path, "/usr/bin/ccache", tmp_path / "build")
with patch.dict("os.environ", {"IDF_CCACHE_ENABLE": "1"}, clear=True), p1, p2, p3:
with (
patch.dict("os.environ", {"IDF_CCACHE_ENABLE": "1"}, clear=True),
patch("esphome.espidf.framework.shutil.which", return_value="/usr/bin/ccache"),
patch("esphome.espidf.framework.tool_version_runs", return_value=True),
p1,
p2,
p3,
):
env = _ccache_env()
assert env["IDF_CCACHE_ENABLE"] == "1"
assert "ccache" not in caplog.text
assert not [r for r in caplog.records if r.levelno >= logging.WARNING]