When you’re running tests across multiple branches and environments, one question always comes up:
“Okay, but which commit and which env did this report come from?”
At first, we were using pytest-html. It’s a solid plugin — if you have time for writing the basic hooks in conftest, it gives you a clean HTML report out of the box. But even after that, there was one big missing piece: execution metadata.
- No branch info.
- No commit ID.
- No environment label.
Basically, the report looked fine, but without context it was just a wall of green/red.
The Boilerplate Phase
Like most devs, we hacked around it.
- Added hooks in conftest.py
- Pulled in env vars for branch/commit
- Injected them manually into the report header
It worked. The first time, it even felt kind of cool — “hey, now our report shows branch and commit!”
But then came the second project.
And the third.
Every repo needed the same glue code. If we fixed one thing, we had to fix it everywhere. The overhead became annoying. Honestly, it felt like I was solving the same problem again and again instead of writing tests.
After repeating the same boilerplate across projects, I started looking around.
Allure was the first obvious option — but honestly, it felt like way too much setup and bloat just to view something as basic as branch, commit, or env metadata and asking my manager to setup java in their system to open the report. I didn’t want dashboards, databases, and 10 extra moving parts. I just wanted a simple HTML report with context.
Thanks to Gemini, It suggested me pytest-html-plus and their screenshot contained the relevant execution metadata I needed which I first thought would have to be configured but
It just… had the metadata baked in.
- Branch name?
- Commit ID (with a GitHub link)?
- Environment pulled from env vars?
All sitting neatly at the top of the same single-page HTML I was already used to. No extra config, no repetitive hooks, no “copy this snippet to every repo.”
We Also removed all of our report generation hooks in the conftest
The best part of it was, it was easily shareable being a self contained html and no setups needed to view by our business.
Why This Changed Things
It sounds small, but it completely changed how we shared reports:
- No more digging through CI logs to see which run this was.
- No more maintaining copy-pasted conftest logic.
Just open the HTML, and all the context is right there.
For me, it turned the report into something I could actually trust at a glance.
If you’re already on pytest-html and tired of wiring up metadata by hand, give pytest-html-plus a look. For us, it was the difference between “yet another report” and “a report with real context.”
Top comments (0)