Skip to content

Reference

code-covered [OPTIONS] COVERAGE_FILE
ArgumentDescription
COVERAGE_FILEPath to coverage.json produced by pytest-cov
OptionDescription
-v, --verboseShow full test templates in output
-o FILE, --output FILEWrite generated test stubs to a file
--priority LEVELFilter by priority: critical, high, medium, low
--limit NMaximum number of suggestions to display
--format FORMATOutput format: text (default) or json
--source-root DIRSource root directory (if coverage paths are relative)
CodeMeaning
0Success (gaps found or no gaps)
1Error (file not found, parse error)

Analyze a coverage JSON file and return gap suggestions.

Parameters:

  • path (str) — Path to the coverage.json file.

Returns:

  • suggestions (list) — List of suggestion objects, each with:
    • test_name (str) — Suggested test function name
    • priority (str) — One of critical, high, medium, low
    • covers_lines (list[int]) — Line numbers this test would cover
    • block_type (str) — Type of uncovered block (e.g., exception_handler, branch, loop)
    • code_template (str) — Ready-to-use test stub
  • warnings (list) — Any warnings encountered during analysis

Print formatted gap suggestions to stdout.

Parameters:

  • suggestions (list) — List of suggestion objects from find_coverage_gaps.
  • Data touched: reads coverage.json (pytest-cov output) and Python source files for AST analysis. All processing is in-memory.
  • Data NOT touched: no network requests, no filesystem writes (except explicit -o output), no OS credentials, no telemetry, no user data collection.
  • Permissions required: read access to coverage report and source files only.

MIT — see LICENSE for details.