From e252637d25480e7de68621684f1c0496c039fe25 Mon Sep 17 00:00:00 2001 From: werdeil Date: Wed, 11 Mar 2020 12:18:47 +0100 Subject: [PATCH 1/2] Do not handle Tag elements as list in environment table --- pytest_html/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest_html/plugin.py b/pytest_html/plugin.py index 4d4d2553..511a1e60 100644 --- a/pytest_html/plugin.py +++ b/pytest_html/plugin.py @@ -25,7 +25,7 @@ # ansi2html is not installed ANSI = False -from py.xml import html, raw +from py.xml import html, raw, Tag from . import extras from . import __version__, __pypi_url__ @@ -564,7 +564,7 @@ def _generate_environment(self, config): value = metadata[key] if isinstance(value, str) and value.startswith("http"): value = html.a(value, href=value, target="_blank") - elif isinstance(value, (list, tuple, set)): + elif isinstance(value, (list, tuple, set)) and not isinstance(value, Tag): value = ", ".join(str(i) for i in sorted(map(str, value))) elif isinstance(value, dict): sorted_dict = {k: value[k] for k in sorted(value)} From 8f21933008726ca83b4e5427eced6077cf3bae83 Mon Sep 17 00:00:00 2001 From: werdeil Date: Thu, 19 Mar 2020 18:09:28 +0100 Subject: [PATCH 2/2] Remove tag part from master as it is handle in another branch --- pytest_html/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest_html/plugin.py b/pytest_html/plugin.py index cfa92f0d..8cd72b63 100644 --- a/pytest_html/plugin.py +++ b/pytest_html/plugin.py @@ -25,7 +25,7 @@ # ansi2html is not installed ANSI = False -from py.xml import html, raw, Tag +from py.xml import html, raw from . import extras from . import __version__, __pypi_url__ @@ -566,7 +566,7 @@ def _generate_environment(self, config): value = metadata[key] if isinstance(value, str) and value.startswith("http"): value = html.a(value, href=value, target="_blank") - elif isinstance(value, (list, tuple, set)) and not isinstance(value, Tag): + elif isinstance(value, (list, tuple, set)): value = ", ".join(str(i) for i in sorted(map(str, value))) elif isinstance(value, dict): sorted_dict = {k: value[k] for k in sorted(value)}