Cover the unreadable ldgen.cmake branch

This commit is contained in:
J. Nick Koston
2026-08-28 10:04:26 -05:00
parent 0aa6c6cc4d
commit 27f05f01cf
@@ -918,6 +918,15 @@ def test_patch_ldgen_cmake_missing_file_is_noop(tmp_path: Path) -> None:
_patch_ldgen_cmake(tmp_path) # no tools/cmake/ldgen.cmake present
def test_patch_ldgen_cmake_unreadable_file_warns_and_skips(
tmp_path: Path, caplog: pytest.LogCaptureFixture
) -> None:
_write_ldgen_cmake(tmp_path, _LDGEN_CMAKE_STOCK)
with patch.object(Path, "read_text", side_effect=OSError("boom")):
_patch_ldgen_cmake(tmp_path)
assert "Could not apply the ldgen dependency patch" in caplog.text
def test_patch_ldgen_cmake_unexpected_depends_skips(
tmp_path: Path, caplog: pytest.LogCaptureFixture
) -> None: