Skip to content

Force results-always when generating HTML #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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