diff --git a/tests/unit_tests/test_platformio_toolchain.py b/tests/unit_tests/test_platformio_toolchain.py index 4b0801909d..416deceadb 100644 --- a/tests/unit_tests/test_platformio_toolchain.py +++ b/tests/unit_tests/test_platformio_toolchain.py @@ -800,9 +800,7 @@ def test_ccache_env_real_probe_runs_stripped_path(setup_core: Path) -> None: with ( patch.dict(os.environ, {}, clear=False), - patch.object( - toolchain.shutil, "which", return_value="\\\\?\\" + sys.executable - ), + patch("shutil.which", return_value="\\\\?\\" + sys.executable), ): os.environ.pop("ESPHOME_CCACHE_ENABLE", None) env = toolchain._ccache_env()