From 321c10ac10bf6156665c90c397ef5510c4ca1902 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 16 Oct 2026 21:07:42 +0000 Subject: [PATCH] A system held perfect is compared to rounding test_importance_is_averaged_over_the_interval asserted that the mean availability with the critical node held working is exactly 1.0, where it is worked out numerically: CI's minimum-dependencies job (numpy 2.0.0 on its runner) summed it to 0.9999999999999999 on the release pull request (#353), while the same suite passed here at the floors. To rounding. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Ng6hwUY8zznhm1jRfZJqZ --- repyability/tests/test_inspection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/repyability/tests/test_inspection.py b/repyability/tests/test_inspection.py index d03f3e3..1011510 100644 --- a/repyability/tests/test_inspection.py +++ b/repyability/tests/test_inspection.py @@ -300,8 +300,9 @@ def test_importance_is_averaged_over_the_interval(): # Every system failure has both failed and both critical. assert rbd.criticality_importance()["a"] == pytest.approx(1.0) assert rbd.fussell_vesely()["a"] == pytest.approx(1.0) - # Held working, "a" makes the system perfect. - assert rbd.mean_availability(working_nodes=["a"]) == 1.0 + # Held working, "a" makes the system perfect (to rounding: the mean is + # worked out numerically, and some numpy builds sum it a unit short). + assert rbd.mean_availability(working_nodes=["a"]) == pytest.approx(1.0) def test_the_cost_rate_trades_tests_against_hidden_downtime():