Skip to main content

pytest-html

reporting

Links

pytest-html is a plugin for the pytest testing framework that generates HTML reports for test results. It enhances the readability and sharing of test outcomes by providing a user-friendly, web-based format. The plugin supports customization of the report’s appearance and content, allowing developers to tailor the reports to their specific needs.


Usage Example

To generate an HTML report for your test suite, run the following command:

pytest --html=report.html

This command executes your tests and produces an report.html file containing the results. To create a self-contained report with embedded assets, use:

pytest --html=report.html --self-contained-html

This approach ensures that all necessary resources are included within the HTML file, making it easier to share and view the report without external dependencies.