Skip to content

Commit 6b7c354

Browse files
committed
Fix codestyle
Signed-off-by: Conor MacBride <[email protected]>
1 parent c53daf7 commit 6b7c354

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pytest_mpl/plugin.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def pytest_configure(config):
181181
results_dir = config.getoption("--mpl-results-path") or config.getini("mpl-results-path")
182182
hash_library = config.getoption("--mpl-hash-library")
183183
generate_summary = config.getoption("--mpl-generate-summary")
184-
results_always = config.getoption("--mpl-results-always") or config.getini("mpl-results-always")
185-
184+
results_always = (config.getoption("--mpl-results-always") or
185+
config.getini("mpl-results-always"))
186186

187187
if config.getoption("--mpl-baseline-relative"):
188188
baseline_relative_dir = config.getoption("--mpl-baseline-path")
@@ -489,7 +489,6 @@ def compare_image_to_hash_library(self, item, fig, result_dir):
489489
error_message = (f"Hash for test '{hash_name}' not found in {hash_library_filename}. "
490490
f"Generated hash is {test_hash}.")
491491

492-
493492
# Save the figure for later summary (will be removed later if not needed)
494493
test_image = (result_dir / "result.png").absolute()
495494
fig.savefig(str(test_image), **savefig_kwargs)
@@ -514,12 +513,14 @@ def compare_image_to_hash_library(self, item, fig, result_dir):
514513
try:
515514
baseline_image_path = self.obtain_baseline_image(item, result_dir)
516515
baseline_image = baseline_image_path
517-
baseline_image = None if (baseline_image and not baseline_image.exists()) else baseline_image
516+
if baseline_image and not baseline_image.exists():
517+
baseline_image = None
518518
# Get the baseline and generate a diff image, always so that
519519
# --mpl-results-always can be respected.
520520
baseline_comparison = self.compare_image_to_baseline(item, fig, result_dir)
521-
except Exception as baseline_error:
521+
except Exception as e:
522522
baseline_image = None
523+
baseline_error = e
523524

524525
# If the hash comparison passes then return
525526
if hash_comparison_pass:

0 commit comments

Comments
 (0)