Skip to content

Commit 44da743

Browse files
committed
fix: update error messages for protected snapshot expiration tests for clarity
1 parent 4df0e83 commit 44da743

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/table/test_expire_snapshots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_cannot_expire_protected_head_snapshot(table_v2: Table) -> None:
4242
assert any(ref.snapshot_id == HEAD_SNAPSHOT for ref in table_v2.metadata.refs.values())
4343

4444
# Attempt to expire the HEAD snapshot and expect a ValueError
45-
with pytest.raises(ValueError, match=f"Cannot expire snapshot {HEAD_SNAPSHOT} as it is referenced by a branch or tag."):
45+
with pytest.raises(ValueError, match=f"Snapshot with ID {HEAD_SNAPSHOT} is protected and cannot be expired."):
4646
table_v2.maintenance.expire_snapshots().by_id(HEAD_SNAPSHOT).commit()
4747

4848
table_v2.catalog.commit_table.assert_not_called()
@@ -65,7 +65,7 @@ def test_cannot_expire_tagged_snapshot(table_v2: Table) -> None:
6565
)
6666
assert any(ref.snapshot_id == TAGGED_SNAPSHOT for ref in table_v2.metadata.refs.values())
6767

68-
with pytest.raises(ValueError, match=f"Cannot expire snapshot {TAGGED_SNAPSHOT} as it is referenced by a branch or tag."):
68+
with pytest.raises(ValueError, match=f"Snapshot with ID {TAGGED_SNAPSHOT} is protected and cannot be expired."):
6969
table_v2.maintenance.expire_snapshots().by_id(TAGGED_SNAPSHOT).commit()
7070

7171
table_v2.catalog.commit_table.assert_not_called()

0 commit comments

Comments
 (0)