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.
Several error-handling and file-output branches in
faircode/cli.pyhave no test coverage, confirmed viamake coverage:--mapwith a missing=or an invalid kind_read_or_exit'sFileNotFoundError/RuntimeError/generic-exception branches--crossinput--referencefileValueError--proxy-hintsRuntimeError--htmlfile-write branch for bothprofileandcompareNone 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.pycases 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 whattests/test_cli.pyalready sets up, no new dependencies.Related but separate: #268 covers a related bug in the same file (
--htmlcrashing 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--htmlbranches above, so probably sequence that one first.