From 97ab27c91470fb25ecf1db4e7321e8ac2568ab6a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 15 Jul 2026 10:33:10 +0000 Subject: [PATCH] =?UTF-8?q?Assert=20water-only=20heat-network=20fuel=20wit?= =?UTF-8?q?h=20the=20file's=20tolerance=20idiom=20=F0=9F=9F=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pytest.approx is untyped under pyright strict, so the new assertions added 3 errors against the repo's zero-new-errors bar. Switches to the abs(...) <= tol form already dominant in this file. No behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../domain/sap10_calculator/rdsap/test_cert_to_inputs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/domain/sap10_calculator/rdsap/test_cert_to_inputs.py b/tests/domain/sap10_calculator/rdsap/test_cert_to_inputs.py index dea7253a9..fb76456dc 100644 --- a/tests/domain/sap10_calculator/rdsap/test_cert_to_inputs.py +++ b/tests/domain/sap10_calculator/rdsap/test_cert_to_inputs.py @@ -1557,8 +1557,8 @@ def test_water_only_heat_network_dhw_fuel_independent_of_plant_type() -> None: heat_pump = hw_fuel_for(952) # Assert — the plant behind the network never reaches the dwelling. - assert chp == pytest.approx(boilers, abs=1e-6) - assert heat_pump == pytest.approx(boilers, abs=1e-6) + assert abs(chp - boilers) <= 1e-6 + assert abs(heat_pump - boilers) <= 1e-6 def test_water_only_heat_network_cylinder_accrues_table_3_primary_loss() -> None: @@ -1676,7 +1676,10 @@ def test_water_only_heat_network_primary_loss_matches_heat_network_main() -> Non # Assert — Table 3's heat-network row keys on the DHW source, not the # space main, so both bill the same insulated p=1.0 / h=3 loss. - assert water_only == pytest.approx(from_network_main, abs=1e-6) + assert all( + abs(water - from_main) <= 1e-6 + for water, from_main in zip(water_only, from_network_main) + ) def test_gas_boiler_main_efficiency_unchanged_by_dlf_override() -> None: