Match the restore report as text; a Windows path is no regex

This commit is contained in:
J. Nick Koston
2026-10-13 07:28:38 -10:00
committed by GitHub
parent e0e5cbdc27
commit 3e6324445b
+4 -1
View File
@@ -470,9 +470,12 @@ def test_restore_finishes_after_any_failure(tmp_path: Path) -> None:
with (
patch("esphome.yaml_edit.write_keeping_mode", side_effect=fail_first),
pytest.raises(RestoreError, match=f"Could not restore {path}: odd"),
pytest.raises(RestoreError) as info,
):
restore_files(originals)
assert f"Could not restore {path}: odd" in str(
info.value
) # a Windows path is no regex
assert "garage" in path.read_text() and other.read_text() == "x: 1\n"
with (
patch(