pytest-html-reporter
Generates a static html report based on pytest framework
What it is and what it does
pytest-html-reporter is a pytest plugin that generates static HTML reports from test execution results. It runs as a pytest command-line extension and produces a self-contained HTML file showing test outcomes, execution trends, suite highlights, and detailed test information. The plugin supports attaching screenshots on test failure (useful for UI testing with Selenium), test rerun tracking, and historical report archiving. It has no runtime dependencies and integrates directly into pytest's reporting pipeline via command-line flags or pytest.ini configuration.
The package is straightforward to use: install it, run pytest with `--html-report` to specify output location, and optionally add `--title` to customize the report heading. For screenshot capture, you import the `attach` function and call it with binary image data during test execution. The generated HTML is static and self-contained, suitable for sharing or archiving test results.
Use it for:
- Generate shareable HTML test reports for CI/CD pipelines to track test execution history and trends over time.
- Capture and embed screenshots in test reports when UI tests fail, for debugging and documentation.
- Archive test results with customizable paths and filenames to organize reports by test suite or date.
- Display test suite highlights and overview statistics in a single-page HTML report for stakeholder review.
- Integrate with pytest.ini to standardize report generation across a team's test infrastructure.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates static HTML test reports from pytest test runs, with support for test history, screenshots on failure, and customizable report paths and titles.
Yes, with conditions. The package is lightweight, permissively licensed, and solves a real need for pytest users who want HTML reports. However, it has not been updated since 2022-02-13 and is marked as aging; before installing, verify that it works with your current pytest and Python versions. The lack of recent maintenance means unresolved issues may not be fixed.
Install
pytest-html-reporter on PyPI
pip
pip install pytest-html-reporteruv
uv add pytest-html-reporterpoetry
poetry add pytest-html-reporterInstalling pytest-html-reporter
Before you install
High install friction; no runtime dependencies but the package has not been updated since 2022-02-13 and maintenance is marked as aging, though the repository remains active.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, provided you include the license notice.
Quickstart
pip install pytest-html-reporter
pytest tests/ --html-report=./report --title='Test Report'
For screenshots on failure:
from pytest_html_reporter import attach
attach(data=self.driver.get_screenshot_as_png())
Verify before relying
- Whether the package works reliably with pytest versions released after 2022-02-13
- Compatibility with modern Python versions beyond the stated >=3.5 requirement
- Whether the aging maintenance status indicates unresolved bugs or compatibility issues
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | aging — 1,643 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 83,731/month — #14,052 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest-html-reporter-0.2.9.tar.gz
Keywords: pytest, py.test, html, reporter, report
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-pspecFormats pytest test output in RSpec-style…
permissive · top 15,000 on PyPI
qase-pytestA pytest plugin that reports test results to…
permissive · top 15,000 on PyPI
pytest-htmlGenerates HTML reports for pytest test results,…
copyleft · top 1,000 on PyPI
tdd-guard-pytestA pytest plugin that captures test results and…
permissive · top 15,000 on PyPI
reportportal-clientA Python client library that sends test…
permissive · top 5,000 on PyPI
behavex-imagesAttaches images to BehaveX HTML test reports,…
permissive · top 15,000 on PyPI
testrail-apiA Python wrapper for the TestRail API that lets…
permissive · top 5,000 on PyPI
pytest-runnerEnables running pytest tests through setup.py…
permissive · top 1,000 on PyPI
pytest-reporterA pytest plugin that generates customizable…
permissive · top 15,000 on PyPI
pytest-pytestrailA pytest plugin that decorates test functions…
permissive · top 15,000 on PyPI