Skip to content

Commit 4946302

Browse files
committed
Fixed issue where values could get to the html without being first converted to a string. This caused a runtime
error.
1 parent 27b9051 commit 4946302

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pytest_html/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ def _generate_environment(self, config):
510510
key_value_list = [f"'{k}': {value[k]}" for k in sorted(value)]
511511
value = ", ".join(key_value_list)
512512
value = "{" + value + "}"
513-
rows.append(html.tr(html.td(key), html.td(raw(value))))
513+
raw_value_string = raw(str(value))
514+
rows.append(html.tr(html.td(key), html.td(raw_value_string)))
514515

515516
environment.append(html.table(rows, id="environment"))
516517
return environment

0 commit comments

Comments
 (0)