pytest-dev / pytest-dev/pytest-html
Defer html generation until after testrun is complete
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I currently have a scenario where a report row needs to be augmented with links to log files collected via a setup/teardown fixture. I'm trying to achieve this via the pytest_runtest_makereport hook but as far as I understand, this is not currently possible since:
A) append_failed/passed only run for report.when=='call', thus no report rows are generated for teardown/setup.
B) Keeping a reference to the call phase report (during pytest_runtest_makereport) and then adding extras to it during the teardown phase report is useless since the relevant row html has already been generated by _appendrow.
Do I understand the limitations correctly? If so, will you be open to considering a PR that allows addition of rows for setup/teardown phases and defers html generation until the testrun has been completed?
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 with pytest_runtest_makereport, append_failed/append_passed, and _appendrow to trace when setup, call, and teardown reports become HTML rows. Determine whether setup and teardown rows can be supported and whether HTML generation can wait until the testrun is complete. Done means fixture-collected log links can be added to the relevant report row during teardown and are present in the final report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100