Skip to content

Commit

Permalink
fix: Add config to report object
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondEvil committed Mar 8, 2023
1 parent 0408b0d commit cf0946b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 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, duration_format):
def __init__(self, title, duration_format, config):
self._config = config
self._data = {
"title": title,
"collectedItems": 0,
Expand All @@ -57,6 +58,10 @@ def __init__(self, title, duration_format):
"additionalSummary": defaultdict(list),
}

@property
def config(self):
return self._config

@property
def data(self):
return self._data
Expand Down Expand Up @@ -85,7 +90,9 @@ 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._duration_format)
self._report = self.Report(
self._report_path.name, self._duration_format, config
)

@property
def css(self):
Expand Down

0 comments on commit cf0946b

Please sign in to comment.