pytest-dev / pytest-dev/pytest-html
Extras added after test execution in fixture are ignored
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
The docs explain that one can use the extras fixture to add content to the html report, however only some of the extras are added. In the following code:
import pytest_html
def test_extra(extras):
extras.append(pytest_html.extras.text("before test!"))
yield # run test
extras.append(pytest_html.extras.text("after test!"))
only the before test part is actually added to the report. The docs don't mention anything about this behavior, so hard to tell if its a bug or not.
If this is a limitation of the framework, it would be really helpful to document it. If not, it would be really handy to fix it.
In my use case, I have a test which generates some files which I'd like to link to from the report. That has to be done after the test completes, but my links never show up in the report.
Thanks!
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 by reproducing the documented extras fixture example and trace how extras are collected into the HTML report before and after test execution. Check whether post-yield extras can be included; done means either those links appear in the report or the limitation is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100