Skip to content

Commit

Permalink
replace hardcoded string with actual report data (pytest-dev#749)
Browse files Browse the repository at this point in the history
Co-authored-by: Michal Kaptur <m.kaptur@satrev.space>
  • Loading branch information
michalkaptur and Michal Kaptur authored Nov 1, 2023
1 parent cbb3b39 commit e407056
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ adds a sortable time column, and removes the links column:
.. code-block:: python
import pytest
from datetime import datetime
def pytest_html_results_table_header(cells):
Expand All @@ -220,8 +221,8 @@ adds a sortable time column, and removes the links column:
def pytest_html_results_table_row(report, cells):
cells.insert(2, "<td>A description</td>")
cells.insert(1, '<td class="col-time">A time</td>')
cells.insert(2, f"<td>{report.description}</td>")
cells.insert(1, f'<td class="col-time">{datetime.utcnow()}</td>')
@pytest.hookimpl(hookwrapper=True)
Expand Down

0 comments on commit e407056

Please sign in to comment.