mirror of
https://github.com/esphome/esphome.git
synced 2026-09-27 06:50:22 +00:00
Merge branch 'esp8266-arduino-toolchain' into esp8266-native-pch
This commit is contained in:
@@ -918,6 +918,30 @@ def test_dict_shorthand_dependency_skips_registry_through_real_converter(
|
||||
# the bundled copy, so the reconciliation passed without raising
|
||||
|
||||
|
||||
def test_versionless_provides_skip_is_reconciled_through_real_converter(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
"""A truly version-less bare-name dependency the walk skips on the
|
||||
backend's promise is recorded and fulfilled by the bundled copy."""
|
||||
framework = _make_framework(tmp_path)
|
||||
_local_lib(tmp_path, ["Wire"])
|
||||
monkeypatch.setenv("ESPHOME_DATA_DIR", str(tmp_path / ".esphome"))
|
||||
libs = _resolve(framework)
|
||||
assert "Wire" in [lib.name for lib in libs]
|
||||
|
||||
|
||||
def test_platform_filtered_bundled_candidate_does_not_break_reconciliation(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
"""A bundled candidate the backend knowingly skips (platform filter)
|
||||
counts as satisfied; the promise reconciliation must not raise."""
|
||||
framework = _make_framework(tmp_path)
|
||||
_local_lib(tmp_path, [{"name": "Wire", "platforms": ["espressif32"]}])
|
||||
monkeypatch.setenv("ESPHOME_DATA_DIR", str(tmp_path / ".esphome"))
|
||||
libs = _resolve(framework)
|
||||
assert "Wire" not in [lib.name for lib in libs]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("bad_name", "message"),
|
||||
[
|
||||
|
||||
@@ -998,8 +998,8 @@ def test_versionless_ignored_dependency_stays_quiet(
|
||||
def test_versionless_dependency_without_provider_warns(
|
||||
tmp_path, monkeypatch, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
"""When no backend tree can supply a version-less dependency, the drop
|
||||
is a warning, not a debug line."""
|
||||
"""A backend whose tree could supply the name warns on the drop; one
|
||||
without provides() can never act on it, so it stays at debug."""
|
||||
_patch_download_with_manifests(
|
||||
monkeypatch,
|
||||
tmp_path,
|
||||
@@ -1011,13 +1011,24 @@ def test_versionless_dependency_without_provider_warns(
|
||||
}
|
||||
},
|
||||
)
|
||||
convert_libraries([Library("esphome/A", None, None)], _backend())
|
||||
convert_libraries(
|
||||
[Library("esphome/A", None, None)], _backend(provides=lambda name: False)
|
||||
)
|
||||
assert (
|
||||
caplog.text.count(
|
||||
"Hash of esphome/A has no version to resolve and nothing provides it"
|
||||
)
|
||||
== 1
|
||||
)
|
||||
caplog.clear()
|
||||
with caplog.at_level(logging.DEBUG):
|
||||
convert_libraries([Library("esphome/A", None, None)], _backend())
|
||||
records = [
|
||||
r
|
||||
for r in caplog.records
|
||||
if "has no version to resolve and nothing provides it" in r.message
|
||||
]
|
||||
assert records and all(r.levelno == logging.DEBUG for r in records)
|
||||
|
||||
|
||||
def test_url_version_dependency_is_not_substituted_by_provides(
|
||||
@@ -1117,7 +1128,9 @@ def test_versionless_url_ish_dependency_name_warns_cleanly(
|
||||
tmp_path,
|
||||
{"esphome/A": {"name": "A", "dependencies": [{"name": "file://"}]}},
|
||||
)
|
||||
convert_libraries([Library("esphome/A", None, None)], _backend())
|
||||
convert_libraries(
|
||||
[Library("esphome/A", None, None)], _backend(provides=lambda name: False)
|
||||
)
|
||||
assert (
|
||||
"file:// of esphome/A has no version to resolve and nothing provides it"
|
||||
in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user