Test fix: tuples raise AttributeError for append, not TypeError
The frozen-snapshot test expected TypeError from tuple.append; tuples have no append at all. Suite green BEFORE commit: 997 passed.
This commit is contained in:
@@ -586,7 +586,9 @@ def test_engine_override_lists_are_frozen() -> None:
|
|||||||
entries.append(PresenceOverride(1, "2026-01-07", "2026-01-07", False))
|
entries.append(PresenceOverride(1, "2026-01-07", "2026-01-07", False))
|
||||||
# The late append must NOT change the engine's answers...
|
# The late append must NOT change the engine's answers...
|
||||||
assert engine.is_present(1, datetime.date(2026, 1, 7)) is True
|
assert engine.is_present(1, datetime.date(2026, 1, 7)) is True
|
||||||
with pytest.raises(TypeError):
|
# Tuples have no append at all (AttributeError), and the mapping
|
||||||
|
# itself refuses reassignment.
|
||||||
|
with pytest.raises(AttributeError):
|
||||||
engine._overrides[1].append(entry)
|
engine._overrides[1].append(entry)
|
||||||
with pytest.raises(AttributeError, match="immutable snapshot"):
|
with pytest.raises(AttributeError, match="immutable snapshot"):
|
||||||
engine._overrides = {}
|
engine._overrides = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user