Skip to content

Zero test coverage for faircode/models.py and faircode/figures.py #417

Description

@yakew7

Where: tests/ directory - no test_models.py or test_figures.py exist at all, despite faircode/models.py and faircode/figures.py both having real, untested failure paths.

The gap:

  • faircode/models.py's build_model with an unrecognized model_name raises a bare KeyError from dict indexing - no test exercises this, and no test verifies hyperparameters/random_state are actually propagated correctly to each of the three model families for a valid name either.
  • faircode/figures.py's plot_strategy_comparison has an explicit if subset.empty: raise ValueError(...) guard that no test triggers, and its main() CLI entry point (argument parsing, the --metric flag, a custom results_dir) is exercised nowhere directly - only indirectly through test_benchmark.py's write_report tests, which never reach the empty-subset or CLI paths.

Why it matters: both are real, reachable code paths (a malformed audit.yaml's model field, or figures.py run standalone via its documented CLI) with zero coverage - a regression in either would ship silently.

Suggested fix: add tests/test_models.py (valid model_name per family + hyperparameter/random_state propagation, and an unknown-name error case) and tests/test_figures.py (the empty-subset ValueError, and a main() smoke test with --metric and a custom output directory).

Activity

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

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions