From baac140cf618bc8bed47d08d095bbca7b29704a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Br=C3=A4nnlund?= Date: Wed, 8 Mar 2023 18:54:45 +0100 Subject: [PATCH] fix: Add config to report object --- src/pytest_html/nextgen.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pytest_html/nextgen.py b/src/pytest_html/nextgen.py index 207eb8e2..219d2d79 100644 --- a/src/pytest_html/nextgen.py +++ b/src/pytest_html/nextgen.py @@ -45,7 +45,8 @@ def insert(self, index, html): self._html[index] = html class Report: - def __init__(self, title): + def __init__(self, title, config): + self._config = config self._data = { "title": title, "collectedItems": 0, @@ -56,6 +57,10 @@ def __init__(self, title): "additionalSummary": defaultdict(list), } + @property + def config(self): + return self._config + @property def data(self): return self._data @@ -86,7 +91,8 @@ def __init__(self, report_path, config, default_css="style.css"): self._max_asset_filename_length = int( config.getini("max_asset_filename_length") ) - self._report = self.Report(self._report_path.name) + + self._report = self.Report(self._report_path.name, config) @property def css(self):