From b3f7c833b9765ccb3eb8b8f17586b87a4c93b7a8 Mon Sep 17 00:00:00 2001 From: Christian Sandberg Date: Sun, 17 May 2020 20:29:58 +0200 Subject: [PATCH] Fix session duration when not finished yet --- pytest_reporter_html1/templates/html1/index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pytest_reporter_html1/templates/html1/index.html b/pytest_reporter_html1/templates/html1/index.html index d6fe987..905f98d 100644 --- a/pytest_reporter_html1/templates/html1/index.html +++ b/pytest_reporter_html1/templates/html1/index.html @@ -20,11 +20,13 @@ {% endif %} - - Duration - {% set duration = ended - started %} - {{ duration|timedelta }} - + {% if ended %} + + Duration + {% set duration = ended - started %} + {{ duration|timedelta }} + + {% endif %} {% if config._metadata %} {% for key, value in config._metadata.items() %}