Skip to content

Commit e407056

Browse files
michalkapturMichal Kaptur
andauthored
replace hardcoded string with actual report data (#749)
Co-authored-by: Michal Kaptur <[email protected]>
1 parent cbb3b39 commit e407056

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/user_guide.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ adds a sortable time column, and removes the links column:
212212
.. code-block:: python
213213
214214
import pytest
215+
from datetime import datetime
215216
216217
217218
def pytest_html_results_table_header(cells):
@@ -220,8 +221,8 @@ adds a sortable time column, and removes the links column:
220221
221222
222223
def pytest_html_results_table_row(report, cells):
223-
cells.insert(2, "<td>A description</td>")
224-
cells.insert(1, '<td class="col-time">A time</td>')
224+
cells.insert(2, f"<td>{report.description}</td>")
225+
cells.insert(1, f'<td class="col-time">{datetime.utcnow()}</td>')
225226
226227
227228
@pytest.hookimpl(hookwrapper=True)

0 commit comments

Comments
 (0)