2121from pathlib import Path
2222from unittest .mock import patch
2323
24- # ---------------------------------------------------------------------------
2524# Import the module under test.
2625# We patch the module-level imports that require the full toolchain.
27- # ---------------------------------------------------------------------------
2826
2927
3028# Create minimal stubs for toolchain modules so coverage.py can be imported
@@ -160,9 +158,7 @@ class _FakeMFCException(Exception):
160158 COVERAGE_CACHE_PATH = _globals ["COVERAGE_CACHE_PATH" ]
161159
162160
163- # ---------------------------------------------------------------------------
164161# Helper: minimal fake test case
165- # ---------------------------------------------------------------------------
166162
167163
168164class FakeCase :
@@ -175,9 +171,7 @@ def get_uuid(self) -> str:
175171 return self ._uuid
176172
177173
178- # ===========================================================================
179174# Group 1: _parse_diff_files — git diff --name-only parsing
180- # ===========================================================================
181175
182176
183177class TestParseDiffFiles (unittest .TestCase ):
@@ -211,9 +205,7 @@ def test_parse_mixed_extensions(self):
211205 assert "CMakeLists.txt" in result
212206
213207
214- # ===========================================================================
215208# Group 2: should_run_all_tests — ALWAYS_RUN_ALL detection
216- # ===========================================================================
217209
218210
219211class TestShouldRunAllTests (unittest .TestCase ):
@@ -280,9 +272,7 @@ def test_mixed_one_trigger_fires_all(self):
280272 )
281273
282274
283- # ===========================================================================
284275# Group 3: filter_tests_by_coverage — core file-level selection logic
285- # ===========================================================================
286276
287277
288278class TestFilterTestsByCoverage (unittest .TestCase ):
@@ -428,9 +418,7 @@ def test_incomplete_coverage_not_triggered_by_preprocess(self):
428418 assert len (skipped ) == 1
429419
430420
431- # ===========================================================================
432421# Group 4: Corner cases from design discussion
433- # ===========================================================================
434422
435423
436424class TestDesignCornerCases (unittest .TestCase ):
@@ -487,9 +475,7 @@ def test_niche_feature_pruning(self):
487475 assert len (skipped ) == 3
488476
489477
490- # ===========================================================================
491478# Group 5: _parse_gcov_json_output — gcov JSON parsing (file-level)
492- # ===========================================================================
493479
494480
495481class TestParseGcovJsonOutput (unittest .TestCase ):
@@ -650,9 +636,7 @@ def test_concatenated_json_skips_zero_coverage(self):
650636 assert result == {"src/simulation/m_rhs.fpp" }
651637
652638
653- # ===========================================================================
654639# Group 6: _normalize_cache — old format conversion
655- # ===========================================================================
656640
657641
658642class TestNormalizeCache (unittest .TestCase ):
@@ -690,9 +674,7 @@ def test_empty_coverage_dict_becomes_empty_list(self):
690674 assert result ["TEST_A" ] == []
691675
692676
693- # ===========================================================================
694677# Group 7: Cache path format
695- # ===========================================================================
696678
697679
698680class TestCachePath (unittest .TestCase ):
@@ -701,9 +683,7 @@ def test_cache_path_is_gzipped(self):
701683 assert str (COVERAGE_CACHE_PATH ).endswith (".json.gz" )
702684
703685
704- # ===========================================================================
705686# Group 8: _compute_gcov_prefix_strip
706- # ===========================================================================
707687
708688
709689class TestComputeGcovPrefixStrip (unittest .TestCase ):
@@ -724,9 +704,7 @@ def test_deep_path(self):
724704 assert result == "5"
725705
726706
727- # ===========================================================================
728707# Group 9: load_coverage_cache
729- # ===========================================================================
730708
731709
732710class TestLoadCoverageCache (unittest .TestCase ):
0 commit comments