pytest-dev / pytest-dev/pytest-html
Possibly allowing better extensibility to html output
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I make use of pytest-html extensively and find the plugin generally fantastic.
In my usage, I have resorted to some substantial modifications to the output content. Recently I found myself going a bit too far and running regexes on output to alter them.
I think the following surgical changes would go a long way in avoiding such poor practices:
- Wrapping body content in a div with class
content - wrapping header in a div with class
summary - and wrapping the results in a div with class
results
The principal motivation of this would be to allow styling the output.
I think the biggest concern would be whether this will break a bunch of CI tests in the universe that have come to rely on the html output.
I apologize if this is a common request that gets closed repeatedly. I searched around in the issues but didn't find anything specifically asking this.
All three of these changes are trivial to implement and I could easily make a PR on short notice.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pytest_html/plugin.py at the referenced results, body, and header output locations around lines 498, 528, and 546. Review the surrounding HTML generation and existing comments before making the three wrapper changes. Done means the output contains results, content, and summary divs with the requested classes while preserving existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100