Skip to content

python -m faircode.figures has no test #1007

Closed

Description

@yakew7

Where: faircode/figures.py (main() and the __main__ guard, lines 98-115), tests/test_figures.py.

Current gap: generate_figures() is tested, but the command-line wrapper that parses --results-dir and --metric, prints "Figures written to ...", and is the documented way to regenerate the plots is never run, so a renamed argument or a broken default would only show up when someone regenerates the figures by hand.

Repro:

$ python3 -m pytest tests -q -m "not slow" --cov=faircode --cov-report=term-missing | grep figures.py
faircode/figures.py ... 115

Suggested approach: call main(["--results-dir", str(tmp_path), "--metric", ...]) against a small results fixture (matplotlib is already required by the existing figure tests) and assert the output line and the written files; add an unknown-metric case.

Activity

  1. yakew7 commented on Oct 16, 2026

    @yakew7
    OwnerAuthor

    Fixed in 2cfe219 (on main). Full suite green (941 passed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions