From feef8b1495eb1b6f97f5f2a898cf1014d5025be6 Mon Sep 17 00:00:00 2001 From: John Tramm Date: Fri, 17 Jul 2026 21:55:23 +0000 Subject: [PATCH] Test that an explicit weight_windows_on=False rides along with the file Co-Authored-By: Claude Fable 5 --- tests/unit_tests/test_model.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit_tests/test_model.py b/tests/unit_tests/test_model.py index 303adcd31e..51ca93e523 100644 --- a/tests/unit_tests/test_model.py +++ b/tests/unit_tests/test_model.py @@ -1199,6 +1199,15 @@ def test_convert_to_multigroup_settings_weight_windows(run_in_tmpdir, monkeypatc # The caller's object is never mutated assert user.weight_windows_file == ww_path + # An explicit weight_windows_on=False rides along with the file and + # overrides the run-time file-implied enable + user = openmc.Settings(weight_windows_file=ww_path, + weight_windows_on=False) + gen = _capture_generation_settings( + monkeypatch, model, method='material_wise', settings=user) + assert gen.weight_windows_file == ww_path + assert gen.weight_windows_on is False + # The surrogate-geometry methods ignore the file with a warning with pytest.warns(UserWarning, match='material_wise'): gen = _capture_generation_settings(