From e4070567db8baed0a33d12b8deca78b0015e2f1d Mon Sep 17 00:00:00 2001 From: Michal Kaptur Date: Wed, 1 Nov 2023 17:50:26 +0100 Subject: [PATCH] replace hardcoded string with actual report data (#749) Co-authored-by: Michal Kaptur --- 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 8dd49029..691c86f2 100644 --- a/docs/user_guide.rst +++ b/docs/user_guide.rst @@ -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, "A description") - cells.insert(1, 'A time') + cells.insert(2, f"{report.description}") + cells.insert(1, f'{datetime.utcnow()}') @pytest.hookimpl(hookwrapper=True)