diff --git a/tests/unit_tests/test_config_validation.py b/tests/unit_tests/test_config_validation.py index f7a05fbc47..78fc39430e 100644 --- a/tests/unit_tests/test_config_validation.py +++ b/tests/unit_tests/test_config_validation.py @@ -3183,6 +3183,17 @@ def test_require_platformio_toolchain() -> None: validator(config) +def test_check_supported_toolchain_unresolved_is_an_ordering_bug() -> None: + """Calling the check before resolution fails naming the ordering bug, + not a user-facing unsupported-toolchain error.""" + from esphome.const import Toolchain + from esphome.core import CORE + + CORE.toolchain = None + with pytest.raises(Invalid, match="not resolved before RP2 validation"): + cv.check_supported_toolchain("RP2", (Toolchain.PLATFORMIO,)) + + @pytest.mark.parametrize( ("platform", "minimal_config"), [