Assert water-only heat-network fuel with the file's tolerance idiom 🟪

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) <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-15 10:33:10 +00:00
parent 7e355ce2ea
commit 97ab27c914

View file

@ -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: