Skip to content

No test covers faircode/cli.py's error-handling branches for --map/--cross/--reference/--proxy-hints or --html output #269

Description

@yakew7

Several error-handling and file-output branches in faircode/cli.py have no test coverage, confirmed via make coverage:

  • Lines 46-53: --map with a missing = or an invalid kind
  • Lines 62-70: _read_or_exit's FileNotFoundError/RuntimeError/generic-exception branches
  • Lines 174-179: malformed --cross input
  • Lines 181-185: --reference file ValueError
  • Lines 190-194: --proxy-hints RuntimeError
  • Lines 197-199 and 229-231: the --html file-write branch for both profile and compare

None of these are exercised by any existing test, meaning a regression in any of them (a broken error message, or a broken file write) would pass CI silently.

Proposed scope: add tests/test_cli.py cases for each branch - most are a few lines each (construct the bad input, assert on the printed error message and exit code). Good first issue: no fixtures beyond what tests/test_cli.py already sets up, no new dependencies.

Related but separate: #268 covers a related bug in the same file (--html crashing with a raw traceback instead of a clean error when the output directory doesn't exist) - fixing that bug first would change what "tested" looks like for the --html branches above, so probably sequence that one first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions