pytest-dev / pytest-dev/pytest-html
Update documentation to contain start time of test instead of end time
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
I added a time column as explained in the user documentation but this adds the end timestamp.
The following seems to achieve more what I want. Some feedback would be great and maybe it is worth updating the documentation?
import pytest
from datetime import datetime
def pytest_html_results_table_header(cells):
cells.insert(2, '<th class="sortable time" data-column-type="time">Time</th>')
def pytest_html_results_table_row(report, cells):
start = datetime.fromtimestamp(report.start)
cells.insert(2, f'<td class="col-time">{start}</td>')
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
report.start = call.start
I am still a bit unsure about the different phases of a test like setup, call and teardown. Maybe this needs extra handling?
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 the user documentation section describing the time column and compare it with the pytest hooks and HTML cells shown in the issue. Check how setup, call, and teardown phases are represented, then update the documentation so the intended timestamp behavior is explicit and verify the example remains accurate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, python
- Domain
- documentation, testing-qa
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100