Get a single, easy-to-read HTML report summarizing all your test results β no hassle, just clarity. Detect flaky tests, and optionally send reports via email**. Works beautifully with or without xdist
.
pip install pytest-html-plus
# or with Poetry
poetry add pytest-html-plus
Generate HTML + JSON reports:
pytest
If you are running with xdist
pytest -n numberOfWorkers
Youβll get:
report.html β a clean, styled HTML report
Option | Description | Default | Choices |
---|---|---|---|
--json-report |
Path to save individual JSON test reports | final_report.json |
Any valid file path |
--capture-screenshots |
When to capture screenshots | failed |
failed , all , none |
--html-output |
Directory to output HTML reports | report_output |
Any valid directory |
--screenshots |
Directory where screenshots will be stored | screenshots |
Any valid directory |
--send-email |
Send HTML report via email after the test run | False |
True , False |
--should-open-report |
Open your HTML report automatically post completion | failed |
always , failed , never |
--generate-xml |
Easily generate combined xml of all runs | False |
False , True |
--xml-report |
Path to output the XML report (used with --generate-xml) | None |
Any valid file path |
Keep using your regular pytest commands β just plug this in to unlock the below powerful reporting features with zero extra effort.
Export a fully merged JUnit XML report effortlessly β no external tools or plugins required. (No More merge html additional plugins or steps in your YAML to feed xml reports)
β Links, logs, stdout/stderr, and even flaky history β all included β Works out-of-the-box with your test management tools (like TestRail, XRay, Zephyr) β Just one flag. No extra lines of code. Total traceability.
With dynamic markers, you can assign tags like api
, critical
, or slow
β or any custom label β at runtime using standard pytest.mark.*
.
No need for custom marker definitions. Perfect for smarter filtering, reporting, and analysis.
π Flaky Test Detection: Automatically flags flaky tests so you can spot and fix inconsistent failures quickly.
π Comprehensive output capture: All your test logs with loggers, print() statements, and screenshots are automatically captured and embedded in the report...
Whether you're trying to trace coverage or track unlinked test cases β this search has your back!
Just start typing, and the dashboard will instantly filter tests by:
β Test name
β Linked issue/documentation IDs (like JIRA, Testmo, Notion, etc.)
β Custom URLs or keywords present in the links
This plugin is aimed at those who are:
-
Tired of writing extra code just to generate reports or capture screenshots
-
Manually attaching logs or outputs to test results
-
Are frustrated with archiving folders full of assets, CSS, JS, and dashboards just to share test results.
-
Donβt want to refactor existing test suites or tag everything with new decorators just to integrate with a reporting tool.
-
Prefer simplicity β a zero-config, zero code, lightweight report that still looks clean, useful, and polished.
-
Want βjust enoughβ β not bare-bones plain text, not a full dashboard with database setup β just a portable HTML report that STILL supports features like links, screenshots, and markers.
Most existing pytest reporter tools:
Only generate HTML reports from a single run (by making you write code for creating xmls like pytest-html) OR they generate all the JS and png files that are not the scope of test results and force you to archive it.
Heavy duty with bloated charts and other test management features(when they arent your only test management system either) increasing your archive size.
This plugin aims to fill those gaps by acting as a companion layer on top of the JSON report, focusing on:
π Merge + flakiness intelligence
π Traceability via metadata
π§Ό HTML thatβs both readable and minimal
π§Ό Quickly copy test paths and run in your local
Send the HTML report via email using --send-email. Please note you will need your own sendgrid setup to use this feature
Create an emailenv file in your project folder that has the following
sender_email=you@example.com
recipient_email=team@example.com
subject=Your Test Report
smtp_server=smtp.sendgrid.net
smtp_port=587
email_password=your_sendgrid_api_key
pytest --send-email
We welcome pull requests, issues, and feature suggestions from the community. Before contributing, please take a moment to review our contribution guidelines and code of conduct. Your involvement helps make this tool better for everyone!
docker build -t pytest-html-plus .
docker run -it pytest-html-plus /bin/bash
poetry install --dev
poetry run pytest tests/
MIT