Skip to content

Commit

Permalink
fix: Add config to report object (pytest-dev#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondEvil committed Apr 3, 2023
1 parent 5c65d2d commit 9bc3310
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pytest_html/nextgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 9bc3310

Please sign in to comment.