Skip to content

Print hash if figure test is new #111

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 2 commits into from
Jan 7, 2021
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
7 changes: 4 additions & 3 deletions pytest_mpl/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,12 @@ def compare_image_to_hash_library(self, item, fig, result_dir):

hash_library = self.load_hash_library(hash_library_filename)
hash_name = self.generate_test_name(item)

test_hash = self.generate_image_hash(item, fig)

if hash_name not in hash_library:
return f"Hash for test '{hash_name}' not found in {hash_library_filename}."

test_hash = self.generate_image_hash(item, fig)
return (f"Hash for test '{hash_name}' not found in {hash_library_filename}. "
f"Generated hash is {test_hash}.")

if test_hash == hash_library[hash_name]:
return
Expand Down