@@ -3367,9 +3367,9 @@ def test_cli_summary_format_stable(
33673367 out = capsys .readouterr ().out
33683368 assert "Summary" in out
33693369 assert out .count ("Summary" ) == 1
3370- assert "Metrics" in out
3371- assert "Adoption" in out
3372- assert "Overloaded" in out
3370+ assert "Metrics" not in out
3371+ assert "Adoption" not in out
3372+ assert "Overloaded" not in out
33733373 assert "callables" in out
33743374 assert "Files parsed" not in out
33753375 assert "Input" not in out
@@ -3383,6 +3383,39 @@ def test_cli_summary_format_stable(
33833383 assert _summary_metric (out , "New vs baseline" ) >= 0
33843384
33853385
3386+ def test_cli_summary_with_metrics_baseline_shows_metrics_section (
3387+ tmp_path : Path ,
3388+ monkeypatch : pytest .MonkeyPatch ,
3389+ capsys : pytest .CaptureFixture [str ],
3390+ ) -> None :
3391+ src = tmp_path / "a.py"
3392+ metrics_baseline_path = tmp_path / "metrics-baseline.json"
3393+ src .write_text ("def f(value: int) -> int:\n return value\n " , "utf-8" )
3394+ _patch_parallel (monkeypatch )
3395+ _run_main (
3396+ monkeypatch ,
3397+ [
3398+ str (tmp_path ),
3399+ "--no-progress" ,
3400+ "--metrics-baseline" ,
3401+ str (metrics_baseline_path ),
3402+ "--update-metrics-baseline" ,
3403+ ],
3404+ )
3405+ _ = capsys .readouterr ()
3406+ _run_main (
3407+ monkeypatch ,
3408+ [
3409+ str (tmp_path ),
3410+ "--no-progress" ,
3411+ "--metrics-baseline" ,
3412+ str (metrics_baseline_path ),
3413+ ],
3414+ )
3415+ out = capsys .readouterr ().out
3416+ assert_contains_all (out , "Metrics" , "Adoption" , "Overloaded" )
3417+
3418+
33863419def test_cli_summary_with_api_surface_shows_public_api_line (
33873420 tmp_path : Path ,
33883421 monkeypatch : pytest .MonkeyPatch ,
@@ -3436,10 +3469,7 @@ def test_cli_ci_summary_includes_adoption_and_public_api_lines(
34363469 ],
34373470 )
34383471 out = capsys .readouterr ().out
3439- assert "Adoption" in out
3440- assert "Public API" in out
3441- assert "symbols=" in out
3442- assert "docstrings=" in out
3472+ assert_contains_all (out , "Adoption" , "Public API" , "symbols=" , "docstrings=" )
34433473
34443474
34453475def test_cli_pyproject_golden_fixture_paths_exclude_fixture_clone_groups (
@@ -3450,6 +3480,7 @@ def test_cli_pyproject_golden_fixture_paths_exclude_fixture_clone_groups(
34503480 fixtures_dir .mkdir (parents = True )
34513481 _write_duplicate_function_module (fixtures_dir , "a.py" )
34523482 _write_duplicate_function_module (fixtures_dir , "b.py" )
3483+ _write_current_python_baseline (tmp_path / "codeclone.baseline.json" )
34533484 report_path = tmp_path / "report.json"
34543485 (tmp_path / "pyproject.toml" ).write_text (
34553486 """
0 commit comments