Registry / testing / pytest-reporter-html1

pytest-reporter-html1

JSON →
library0.9.5pypypiunverified

Pytest-reporter-html1 is a basic HTML report template for Pytest, leveraging the Jinja2 template engine. It extends `pytest-reporter` to generate rich, expandable reports covering test files, phases, and detailed test information. The current version is 0.9.5, and it maintains an active release cadence for bug fixes and feature enhancements.

pip install pytest-reporter-html1
INSTALL
IMPORT
SIG · PYTEST-REPORTER-HT
P
pytest-reporter-html1
testingpythonv0.9.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

To generate an HTML report, run pytest with the `--template` and `--report` command-line options. The `--template` argument specifies the template to use (here, `html1/index.html`), and `--report` defines the output path and filename for the generated HTML report. By default, the report is self-contained. Use `--split-report` to separate assets like CSS and JavaScript.

# tests/test_example.py def test_success(): assert True def test_failure(): assert False # Run from your terminal in the project root # This command will generate a detailed HTML report named 'report.html' # using the html1 template. # pytest --template=html1/index.html --report=report.html # To make the report self-contained (embed CSS, JS, images): # pytest --template=html1/index.html --report=report.html --split-report=False # Note: --split-report=False is the default behavior. For older versions, --self-contained might be used, but is deprecated. # To split assets (CSS, JS, images) into separate files: # pytest --template=html1/index.html --report=report.html --split-report
Debug
Known issues
gotchaConfusing `--html` with `--report`: Users migrating from or familiar with `pytest-html` often incorrectly try to use `--html=report.html` for report generation. `pytest-reporter-html1` uses `--report=report.html` instead.
fix
Always use `--report=report.html` to specify the output file and `--template=html1/index.html` to select the HTML1 template with `pytest-reporter-html1`.
affects: All versions
gotchaNo native screenshot support: Unlike some other HTML reporters, `pytest-reporter-html1` does not natively support embedding screenshots on test failures. Custom `pytest` hooks (e.g., `pytest_runtest_makereport`) must be implemented to add this functionality.
fix
Implement a custom `pytest_runtest_makereport` hook in your `conftest.py` to capture and attach screenshot data to the report context, using the provided `asset` filter in your custom Jinja2 template.
affects: All versions
deprecated`DeprecationWarning: 'jinja2.Markup'` for older versions: Versions of `pytest-reporter-html1` prior to 0.8.x might issue a `DeprecationWarning` related to `jinja2.Markup`, advising to import `markupsafe.Markup` instead.
fix
Upgrade `pytest-reporter-html1` to version 0.8.x or newer to resolve this warning. The issue was closed as completed, indicating a fix was implemented.
affects: <0.8.x
Errors
Common errors & fixes
pytest: error: unrecognized arguments: --html=report.html
Attempting to use the `--html` argument, which is associated with `pytest-html`, instead of the correct `--report` argument for `pytest-reporter-html1`.
fix
Change the command-line argument from `--html=report.html` to `--report=report.html` and ensure you also specify `--template=html1/index.html`. Example: `pytest --template=html1/index.html --report=report.html`.
TypeError: unhashable type: 'dict' during report generation
This error has been reported in GitHub issues and can occur with specific test structures or interactions with other plugins, where dictionary objects are incorrectly used as hashable keys.
fix
Check for open issues on the `pytest-reporter-html1` GitHub repository, ensure all related plugins (e.g., `pytest`, `pytest-reporter`) are up-to-date, and consider simplifying complex test data structures if a minimal reproducible example can be created. If the issue persists, filing a bug report with a minimal reproducible example is recommended.
Upgrade
Version history
0.9.5latest on PyPI · released Oct 10, 2025
Audit
Dependencies
pytestrequiredCore testing framework that this plugin extends.
pytest-reporterrequiredProvides the underlying data structure and hooks for report generation, on which pytest-reporter-html1 is based.
Jinja2requiredTemplating engine used for rendering the HTML report.
MarkupSaferequiredDependency for Jinja2, also addressed in older deprecation warnings.
pytest-metadataoptionalSupported for enhanced report metadata.
pytest-rerunfailuresoptionalSupported for showing rerun information in reports.
Agent activity
4 hits · last 30 days
node
4
Resources
pytest-reporter-html1 — pip install pytest-reporter-html1 · libregistry