A test run with several failures does not always mean that every test broke for a different reason.
In one run, four tests might fail after an authentication change. Seven others might fail because a downstream service is unavailable. A few more failures may be completely unrelated.
The report is full of red, but there are different patterns underneath it. The difficult part is working out which failures belong together.
My usual workflow was to open one failed test, read the error, go back, open another, compare it, and repeat. After a few tests, I would start asking:
Have I already seen this error, or does this one only look familiar?
That is the small but expensive debugging loop I kept running into with ordinary test reports.
The report should help you spot patterns
Recently, I tried the Similar Errors feature in pytest-html-plus 1.4.0. It addresses this problem in a surprisingly practical way.
When multiple tests finish with matching failure messages, the report adds a layers badge beside each affected test. The number on the badge tells you how many other tests have a similar error.
Click it and you can:
- see the matching error message;
- see every other test in that group;
- jump directly to any of those test results; and
- copy links to the entire group in one click.
So instead of opening every failure and trying to remember which messages I have already seen, I can see the groups immediately.
Imagine four account tests fail with:
AuthenticationError: token audience is invalid
In the same run, seven checkout and order tests fail with:
ConnectionError: Inventory service is unavailable
The authentication failures form one group. Each test in it gets a badge showing three other similar failures. The inventory failures form a second group, with each badge showing six others. Any failures with distinct messages remain separate.
Open a badge from one of the four authentication tests and I can move through that group without mixing it up with the seven inventory failures. Open a badge in the inventory group and I get the second set.
The feature does not tell me that all eleven tests have one root cause. It helps me see that the run contains at least two useful failure patterns that deserve separate investigation.
For me, that changes the first debugging question from:
Which test should I inspect next?
to:
What do these tests have in common?
That is usually a much better place to start.
Copy the whole failure cluster, not one test at a time
Finding the pattern is only half the job. Often, the next step is sharing it with a teammate.
The Similar Errors popover has a copy button that collects a direct link to every test in the selected group, including the current test. For the four authentication failures, the result might look like this:
test_create_user — https://ci.example.com/report.html#test-abc
test_update_user — https://ci.example.com/report.html#test-def
test_delete_user — https://ci.example.com/report.html#test-ghi
test_view_user — https://ci.example.com/report.html#test-jkl
Paste that into Slack, Teams, an issue, or a pull request. Anyone with access to the hosted report can open a link and land on the exact test, already revealed, expanded, and highlighted.
No “scroll halfway down the report.” No screenshots with arrows. No copying four separate URLs.
This sounds like a small feature. It is. But debugging speed is often the result of removing many small interruptions.
The matching is deliberately conservative
The feature also avoids grouping context free failures such as a bare assert False or a generic “operation timed out.” Those messages do not contain enough information to make a useful match.
From what I have seen, it intentionally prefers missing an occasional match over confidently grouping unrelated failures. I think that is the right trade off for a debugging report.
And the UI says this clearly: similar messages may have different causes.
The report is giving you a strong lead, not pretending to perform root cause analysis.
Why not stay with a basic pytest HTML report?
A basic report answers an important question:
Which tests passed and failed?
But once a suite grows, that is only the beginning of the investigation.
You also need to understand retries, inspect screenshots, search errors and traces, work with parallel execution, share one exact result, and now identify repeated failure patterns. If each of those steps requires another plugin, another script, or another manual workflow, the cost adds up.
What I like about pytest-html-plus is that it seems to be built around a different question:
What will help a developer move from “the build is red” to “here is the pattern, the evidence, and the next thing to investigate”?
Similar Errors is one example. As a user, I also get:
- one merged report for normal and pytest-xdist runs;
- automatic failure screenshots for Playwright and Selenium;
- errors, traces, logs, stdout, and stderr together;
- full retry history for flaky tests;
- universal search across tests and failure context; and
- direct, copyable links to individual test results.
I would not claim that one feature makes debugging 10 or 20 times faster in every project. But it removes ten or twenty points of friction from every failed CI run. That compounding effect is where I notice the real time saving.
Try it
Install the package and run pytest as usual:
pip install pytest-html-plus
pytest
What made it easy for me to try was that there was no reporting server to maintain, and I did not need to add hooks or decorators to my tests. The output is a portable HTML report plus structured JSON.
You can explore their demo report, read the documentation, or find their project on GitHub.

Top comments (0)