replace hardcoded string with actual report data (#749)

Co-authored-by: Michal Kaptur <m.kaptur@satrev.space>
This commit is contained in:
Michal Kaptur 2023-11-01 17:50:26 +01:00 committed by GitHub
parent cbb3b3982a
commit e4070567db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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):
@ -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)