Skip to content

Commit

Permalink
Merge pull request #131 from ConorMacBride/html-results-always
Browse files Browse the repository at this point in the history
Force results-always when generating HTML
  • Loading branch information
Cadair authored Feb 3, 2022
2 parents c07ec34 + 49580f9 commit e1bf8dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pytest_mpl/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ def pytest_addoption(parser):
group.addoption('--mpl-results-path', help=results_path_help, action='store')
parser.addini('mpl-results-path', help=results_path_help)

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

Expand Down

0 comments on commit e1bf8dd

Please sign in to comment.