# pytest-html

> pytest plugin for generating HTML reports

- **URL**: https://www.freshcrate.ai/projects/pytest-html
- **Author**: pypi
- **Category**: Frameworks
- **Latest version**: `4.2.0` (2026-04-21)
- **License**: Unknown
- **Source**: https://github.com/pytest-dev/pytest-html
- **Homepage**: https://pypi.org/project/pytest-html/
- **Language**: Python
- **GitHub**: 768 stars, 252 forks
- **Registry**: pypi (`pytest-html`)
- **Tags**: `html`, `pypi`, `pytest`, `report`

## Description

pytest-html
===========

pytest-html is a plugin for `pytest <http://pytest.org>`_ that generates a HTML report for test results.

.. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg
   :target: https://github.com/pytest-dev/pytest-html/blob/master/LICENSE
   :alt: License
.. image:: https://img.shields.io/pypi/v/pytest-html.svg
   :target: https://pypi.python.org/pypi/pytest-html/
   :alt: PyPI
.. image:: https://img.shields.io/conda/vn/conda-forge/pytest-html.svg
   :target: https://anaconda.org/conda-forge/pytest-html
   :alt: Conda Forge
.. image:: https://github.com/pytest-dev/pytest-html/workflows/gh/badge.svg
   :target: https://github.com/pytest-dev/pytest-html/actions
   :alt: CI
.. image:: https://img.shields.io/requires/github/pytest-dev/pytest-html.svg
   :target: https://requires.io/github/pytest-dev/pytest-html/requirements/?branch=master
   :alt: Requirements
.. image:: https://codecov.io/gh/pytest-dev/pytest-html/branch/master/graph/badge.svg?token=Y0myNKkdbi
   :target: https://codecov.io/gh/pytest-dev/pytest-html
   :alt: Codecov

Resources
---------

- `Documentation <https://pytest-html.readthedocs.io/en/latest/>`_
- `Release Notes <https://pytest-html.readthedocs.io/en/latest/changelog.html>`_
- `Issue Tracker <http://github.com/pytest-dev/pytest-html/issues>`_
- `Code <http://github.com/pytest-dev/pytest-html/>`_

Contributing
------------

We welcome contributions.

To learn more, see `Development <https://pytest-html.readthedocs.io/en/latest/development.html>`_

Screenshots
-----------

.. image:: https://cloud.githubusercontent.com/assets/122800/11952194/62daa964-a88e-11e5-9745-2aa5b714c8bb.png
   :target: https://cloud.githubusercontent.com/assets/122800/11951695/f371b926-a88a-11e5-91c2-499166776bd3.png
   :alt: Enhanced HTML report

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `4.2.0` | 2026-04-21 | Low | Imported from PyPI (4.2.0) |
| `4.1.1` | 2023-11-07 | Low | ## Changes  * fix: Latest eslint is broken (#769) @BeyondEvil * fix: original sort order (#768) @BeyondEvil * [pre-commit.ci] pre-commit autoupdate (#763) @pre-commit-ci |
| `4.1.0` | 2023-11-04 | Low | ## Changes  * Release v4.1.0 (#761) @BeyondEvil * fix: Escaping HTML in log (#757) @BeyondEvil * test: Add UTF8 test (#760) @BeyondEvil * [pre-commit.ci] pre-commit autoupdate (#563) @pre-commit-ci * fix: Only run npm when building from source (#758) @BeyondEvil * Fix results table modification documentation (#749) @michalkaptur * fix: Add collections errors to report (#756) @BeyondEvil * fix: Revert report generation to full run (#754) @BeyondEvil * fix: Broken duration (#753) @Beyond |
| `4.0.2` | 2023-09-14 | Low | ## Changes  * Fix: Use absolute path for the report (#735) @adrien-berchet |
| `4.0.1` | 2023-09-10 | Low | ## Changes  * fix: Incorrect label for xfailed (#733) @BeyondEvil * chore: block commits to master (#734) @BeyondEvil |
| `4.0.0` | 2023-09-01 | Low | ## Changes  * Release v4.0.0 (#725) @BeyondEvil * Feat: Add duration format hook (#724) @BeyondEvil * Chore: Drop support for python 3.7 (#723) @BeyondEvil * Add expander to log output (#721) @drRedflint * Fix: Broken sorting for custom columns (#715) @BeyondEvil * Chore: Stop running scheduled tests on forks (#720) @BeyondEvil * Chore: Fix tox (#718) @BeyondEvil * use max height instead of fixed height (#706) @drRedflint * if only one item in gallery, remove navigation (#705) @drRedfl |
| `v3.2.0` | 2022-11-11 | Low | ## Changes  * Revert "Rename master branch to main" (#562) @BeyondEvil * Release v3.2.0 (#556) @BeyondEvil * Add py as dependency (#555) @smartEBL * pip isn't a build dependency (#516) @rossburton * Migrate to precommit.ci (#487) @BeyondEvil * Use the tests reusable workflow (#486) @BeyondEvil  ## Minor Changes  * Allow for redacting of environment table values (#431) @gnikonorov * Implement the visible URL query parameter to control visibility of test results on page load. (#433) @g |
| `v3.1.1` | 2022-07-04 | Low | - Fix issue with reporting of missing CSS files. (https://github.com/pytest-dev/pytest-html/issues/388) |
| `v3.1.0` | 2022-07-04 | Low | - Stop attaching test reruns to final test report entries (https://github.com/pytest-dev/pytest-html/issues/374) - Allow for report duration formatting (https://github.com/pytest-dev/pytest-html/issues/376) |
| `v3.0.0` | 2022-07-04 | Low | - Respect --capture=no, --show-capture=no, and -s pytest flags (https://github.com/pytest-dev/pytest-html/issues/171) - Make the Results table Links column sortable (https://github.com/pytest-dev/pytest-html/issues/242) - Fix issue with missing image or video in extras. (https://github.com/pytest-dev/pytest-html/issues/265 and https://github.com/pytest-dev/pytest-selenium/issues/237) [@christiansandberg](https://github.com/christiansandberg) and [@superdodd](https://github.com/superdodd) and |

## Citation

- HTML: https://www.freshcrate.ai/projects/pytest-html
- Markdown: https://www.freshcrate.ai/projects/pytest-html.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/pytest-html/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
