Getting Started
Installation
For LLM support:
# Ollama (local)
pip install pytest-llm-report[ollama]
# LiteLLM (cloud)
pip install pytest-llm-report[litellm]
# Gemini (cloud)
pip install pytest-llm-report[gemini]
Prerequisites
You need pytest-cov with context tracking:
Basic Usage
1. Configure coverage
Add to your pyproject.toml:
[tool.pytest.ini_options]
addopts = [
"--cov=your_package",
"--cov-context=test",
"--cov-report=",
]
2. Generate a report
Optional: PDF output
PDF output uses Playwright to render the HTML report.
pip install playwright
playwright install chromium
pytest --llm-report=report.html --llm-pdf=report.pdf
3. View the report
Open report.html in a browser to see:
- Test summary (passed/failed/skipped)
- Per-test coverage (files and lines)
- Filter and search functionality
- Dark mode (automatic based on system preferences)
Next Steps
- Configuration - All options
- Coverage Setup - Coverage contexts explained
- LLM Providers - Add AI annotations
- Troubleshooting - Common issues and solutions