Skip to content

Commit

Permalink
Undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Jul 2, 2021
1 parent c3ba918 commit 5ddddc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pytest_mpl/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def compare_image_to_hash_library(self, item, fig, result_dir):

# If this is not a new test try and get the baseline image.
if not new_test:
baseline_error = None
# Ignore Errors here as it's possible the reference image dosen't exist yet.
try:
baseline_image_path = self.obtain_baseline_image(item, result_dir)
Expand All @@ -525,7 +526,9 @@ def compare_image_to_hash_library(self, item, fig, result_dir):
return

if baseline_image is None:
error_message += f"\nUnable to find baseline image for {item}.\n{baseline_error}"
error_message += f"\nUnable to find baseline image for {item}."
if baseline_error:
error_message += f"\n{baseline_error}"
return error_message

# Override the tolerance (if not explicitly set) to 0 as the hashes are not forgiving
Expand Down

0 comments on commit 5ddddc8

Please sign in to comment.