Skip to main content

Human-friendly pytest test reports with optional LLM annotations

Project description

pytest-llm-report

CI Docs codecov PyPI Python Versions License pytest plugin

Human-friendly pytest test reports with optional LLM annotations.

Features

  • Test inventory with status (pass/fail/skip/xfail) and duration
  • Per-test covered files and line ranges (using pytest-cov + coverage contexts)
  • Per-file source coverage summary (covered/missed/percentage)
  • Optional LLM-generated annotations:
    • Scenario: What the test verifies
    • Why needed: What regression/bug it prevents
    • Key assertions: Critical checks performed
  • HTML and JSON output formats
  • Dark mode support (auto-detects system preference)
  • Optional PDF generation
  • Detailed Versioning: Reports include exact plugin and repository versions (plus Git SHA/dirty status) for reproducibility
  • Aggregation across multiple test runs (see Aggregation)

Installation

pip install pytest-llm-report

Or with uv:

uv add pytest-llm-report

Optional Dependencies

Install additional features as needed:

# Ollama provider
pip install pytest-llm-report[ollama]

# Gemini provider
pip install pytest-llm-report[gemini]

# LiteLLM provider (supports OpenAI, Anthropic, etc.)
pip install pytest-llm-report[litellm]

# PDF generation
pip install pytest-llm-report[pdf]

# All features
pip install pytest-llm-report[all]

With uv:

uv add "pytest-llm-report[ollama]"  # or gemini, litellm, pdf, all

Quick Start

Run pytest with coverage contexts enabled:

pytest --cov=your_package --cov-branch --cov-context=test --llm-report=report.html

Configuration

Configure via pyproject.toml:

[tool.pytest_llm_report]
provider = "none"  # "none", "ollama", "litellm", or "gemini"
report_json = "reports/pytest_llm_report.json"

Documentation

📖 Full documentation: palakpsheth.github.io/pytest-llm-report

Requirements

  • Python 3.11+
  • pytest >= 7.0.0
  • pytest-cov >= 4.0.0

Contributing

Contributions are welcome! Please see:

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_llm_report-0.1.0.tar.gz (93.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_llm_report-0.1.0-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest_llm_report-0.1.0.tar.gz.

File metadata

  • Download URL: pytest_llm_report-0.1.0.tar.gz
  • Upload date:
  • Size: 93.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytest_llm_report-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4c7ddb6983fa9a9219c97e73f2d5029410e2bb8fe786f322af39518e30ac5a82
MD5 df59e1f0d670e7a211395f0cfb54b717
BLAKE2b-256 0cb13e0d60a99abd482ef06d2a241c1c6a1c8bc578fe0402f3b7aa9bd2846ebe

See more details on using hashes here.

File details

Details for the file pytest_llm_report-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_llm_report-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pytest_llm_report-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc4143616a2a0209613561ebfc9e94e5b29bd7d651f7c3b4d3bc2c54b41665e
MD5 a9f2f11789fb294ff65ad18766687dc2
BLAKE2b-256 f62c8f6711e40b75629c7c1f41ccf644f68f729073c2847ee7975ab467c71793

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page