Feature request: Support for adding your own sections
Hello, I wish to add my own section that includes test configurations so I can separate information about test env. and test config. Is it possible to add it already or is this a feature that would be needed? I tried to look though the source code but I can't figure out if the environment section is built into pytest-html or built into Python
Not sure what exactly you're trying to do. Can you maybe elaborate a little more?
The environment section is part of pytest-html and you can add sections to that using the pytest-metadata plugin.
What i want is to add my own completely isolated section. So I don't combine environment section and my own section as this section can become rather big with many configurations I would like to hide it.
I did conclude my own question. It is part of pytest-html and would be a feature request. I am working on right now trying to figure out how to access the set_data function though pytest session fixture but It seems like that might not be possible.
Here is a example of what I want:
You can more or less accomplish this using the pytest_html_results_summary hook.
Yeah, it could just be moved to "Summary" instead of under environment. But this would require me to copy in the whole function of renderStatic and all of It's sub functions right? Or do you have a smarter idea in mind?
You shouldn't have to copy or modify anything. Just build the HTML as you want it and pass it to the hook. The report will then render it.