Fail on a declared-but-absent extraScript, warn once per unsupported env method, split and widen tests

This commit is contained in:
J. Nick Koston
2026-08-20 19:25:33 -05:00
parent ef2f16713a
commit 5bd328e6c4
4 changed files with 38 additions and 21 deletions
+6 -3
View File
@@ -538,12 +538,15 @@ def test_split_flag_entry_unbalanced_quote_is_clean() -> None:
from esphome.platformio.library import split_flag_entry
assert split_flag_entry('-DX="a b"', "library x") == ["-DX=a b"]
# join_flag_args re-glues a spaced -D like ParseFlags does
with pytest.raises(EsphomeError, match=r"Malformed build flag.*library x"):
split_flag_entry('-DX="unclosed', "library x")
def test_join_flag_args_reglues_spaced_define() -> None:
"""A spaced -D re-glues to its argument, as ParseFlags does."""
from esphome.platformio.library import join_flag_args
assert join_flag_args(["-D", "FOO=1", "-Os"], "x") == ["-DFOO=1", "-Os"]
with pytest.raises(EsphomeError, match=r"Malformed build flag.*library x"):
split_flag_entry('-DX="unclosed', "library x")
def test_join_flag_args_trailing_bare_flag_warns(