From d3f6cbe14a8be05dba47b0b7285a58b42186305f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 25 Aug 2026 14:06:32 -0500 Subject: [PATCH] Patch the direct ccache probe in the usable-binary test --- tests/unit_tests/test_espidf_framework.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_espidf_framework.py b/tests/unit_tests/test_espidf_framework.py index 9240e69eed..0f727857e9 100644 --- a/tests/unit_tests/test_espidf_framework.py +++ b/tests/unit_tests/test_espidf_framework.py @@ -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]