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]