From 0b6266c328f2fbcb4dd385c9eb6e8595de11a78a Mon Sep 17 00:00:00 2001 From: franks Date: Fri, 17 Apr 2026 11:44:11 -0400 Subject: [PATCH] Fix(template): Replace hardcoded "rerun" check with Jinja2 loop.last for comma logic The comma condition in the outcomes loop was hardcoded to check `result != "rerun"`, which breaks since #836 added "retried" after "rerun" in the outcomes dict. Using Jinja2's `loop.last` is the correct, order-independent approach. Ref: https://github.com/pytest-dev/pytest-html/pull/836 --- src/pytest_html/resources/index.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytest_html/resources/index.jinja2 b/src/pytest_html/resources/index.jinja2 index d899375e..42682c06 100644 --- a/src/pytest_html/resources/index.jinja2 +++ b/src/pytest_html/resources/index.jinja2 @@ -83,7 +83,7 @@
{%- for result, values in outcomes.items() %} - {{ values["value"] }} {{ values["label"] }}{{ "," if result != "rerun" }} + {{ values["value"] }} {{ values["label"] }}{{ "," if not loop.last }} {%- endfor %}