diff --git a/tests/test_gui_2_result.py b/tests/test_gui_2_result.py index 1bba1670..a1107405 100644 --- a/tests/test_gui_2_result.py +++ b/tests/test_gui_2_result.py @@ -1355,6 +1355,8 @@ def test_phase_6_invariant_signal_handler_count_dropped(): Pre-Phase 6 baseline: 3 (L591 _diag_layout_state, L897 _capture_workspace_profile, L4321 worker). Post-Phase 6 baseline: 3 (unchanged; Phase 6 has 0 sites). + Uses <= to remain robust against later-phase migrations (Phases 7-8 will + drop the count to 0; this test continues to pass since 0 <= 3). """ result = subprocess.run( ["uv", "run", "python", "scripts/audit_exception_handling.py", "--src", "src", "--json"], @@ -1369,9 +1371,9 @@ def test_phase_6_invariant_signal_handler_count_dropped(): gui2 = [f for f in data.get("files", []) if "gui_2" in f.get("filename", "")][0] broad_catches = [f for f in gui2.get("findings", []) if f.get("category") == "INTERNAL_BROAD_CATCH"] # Phase 6 baseline is 3 (no migration occurred since Phase 5 ended). - # This test pins the count to 3 before Phases 7, 8, 9 each migrate sites. - assert len(broad_catches) == 3, ( - f"Phase 6 invariant: expected exactly 3 INTERNAL_BROAD_CATCH sites in " + # This test pins the upper bound to 3 before Phases 7, 8, 9 each migrate sites. + assert len(broad_catches) <= 3, ( + f"Phase 6 invariant: expected <= 3 INTERNAL_BROAD_CATCH sites in " f"src/gui_2.py (Phase 6 has 0 sites to migrate; pre-Phase-7 baseline); " f"found {len(broad_catches)}. Lines: {[f.get('line') for f in broad_catches]}" )