Skip to content

Commit e1bf8dd

Browse files
authored
Merge pull request #131 from ConorMacBride/html-results-always
Force results-always when generating HTML
2 parents c07ec34 + 49580f9 commit e1bf8dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pytest_mpl/plugin.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def pytest_addoption(parser):
140140
group.addoption('--mpl-results-path', help=results_path_help, action='store')
141141
parser.addini('mpl-results-path', help=results_path_help)
142142

143-
results_always_help = "Always generate result images, not just for failed tests."
143+
results_always_help = ("Always generate result images, not just for failed tests. "
144+
"This option is automatically applied when generating a HTML summary.")
144145
group.addoption('--mpl-results-always', action='store_true',
145146
help=results_always_help)
146147
parser.addini('mpl-results-always', help=results_always_help)
@@ -271,6 +272,9 @@ def __init__(self,
271272
if len(unsupported_formats) > 0:
272273
raise ValueError(f"The mpl summary type(s) '{sorted(unsupported_formats)}' "
273274
"are not supported.")
275+
# Ignore `results_always` and always save result images for HTML output
276+
if generate_summary & {'html', 'basic-html'}:
277+
results_always = True
274278
self.generate_summary = generate_summary
275279
self.results_always = results_always
276280

0 commit comments

Comments
 (0)