Temperature bound test: assert the default is at most 5 s, not exactly 5 s

The original only bounded the elapsed time, so == 5.0 was stricter than the
requirement it replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-01 17:31:26 +01:00
parent f04b0d0efd
commit 8b0fb81d7b

View File

@ -138,11 +138,13 @@ class TestNothingEscapesTheFetch:
def test_the_whole_check_is_bounded_by_the_hard_timeout(self) -> None:
"""The user's requirement: at most 5s, then lock regardless.
The bound is the default argument, so it is pinned to 5s here and the
mechanism is timed at 0.1s: the same guarantee without 5 real seconds.
The bound is the default argument, so it is pinned to at most 5s here
and the mechanism is timed at 0.1s: the same guarantee without 5 real
seconds.
"""
default = signature(fetch_current_temp_with_status).parameters["hard_timeout"]
assert default.default == HARD_TIMEOUT_SECONDS == 5.0
assert default.default == HARD_TIMEOUT_SECONDS
assert HARD_TIMEOUT_SECONDS <= 5.0
hang = threading.Event()
with patch(
"screen_locker._temperature._fetch_current_temp_celsius_unbounded",