From ee273e54a530e5209813aa46a21a3ab0c542c884 Mon Sep 17 00:00:00 2001 From: Michal Kaptur Date: Tue, 17 Oct 2023 11:41:37 +0200 Subject: [PATCH] replace hardcoded string with actual report data --- docs/user_guide.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/user_guide.rst b/docs/user_guide.rst index 5708bc1f..8ff7248c 100644 --- a/docs/user_guide.rst +++ b/docs/user_guide.rst @@ -200,6 +200,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): @@ -208,8 +209,8 @@ adds a sortable time column, and removes the links column: def pytest_html_results_table_row(report, cells): - cells.insert(2, "A description") - cells.insert(1, 'A time') + cells.insert(2, f"{report.description}") + cells.insert(1, f'{datetime.utcnow()}') @pytest.hookimpl(hookwrapper=True)