Getting Started
Installation
Section titled “Installation”Install from PyPI:
pip install code-coveredQuick start
Section titled “Quick start”1. Generate coverage data
Section titled “1. Generate coverage data”Run your tests with JSON coverage output:
pytest --cov=myapp --cov-report=jsonThis produces a coverage.json file in your project root.
2. Analyze your gaps
Section titled “2. Analyze your gaps”code-covered coverage.jsonYou’ll see a prioritized list of missing tests, ranked by risk.
3. Generate test stubs
Section titled “3. Generate test stubs”Write ready-to-use test stubs directly to a file:
code-covered coverage.json -o tests/test_gaps.pyOpen the generated file, fill in the TODOs, and run your tests again.
For developers
Section titled “For developers”Clone and set up a development environment:
git clone https://github.com/mcp-tool-shop-org/code-covered.gitcd code-covered
python -m venv .venvsource .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
# Run testspytest -v
# Run with coveragepytest --cov=analyzer --cov=mcp_code_covered --cov=cli --cov-report=term-missing
# Linting and type checkingruff check analyzer mcp_code_covered cli.py testspyright analyzer mcp_code_covered cli.py tests