Skip to content

Commit

Permalink
Test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
spirali committed Jan 30, 2025
1 parent 7d11a51 commit b761fe9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def helper(**kwargs):
def deck(deck_builder):
return deck_builder()


if os.path.isdir(CURRENT_DIR):
shutil.rmtree(CURRENT_DIR)
os.mkdir(CURRENT_DIR)
8 changes: 3 additions & 5 deletions tests/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ def compare_images(new_dir, old_dir, n_slides, threshold, resize=False):
difference = ImageChops.difference(new_img, old_img)
stat = ImageStat.Stat(difference)
diff = sum(stat.sum) / 255.0
# if diff > threshold:
# combined = concat_images([new_img, old_img, difference])
# path = os.path.abspath(f"combined-{name1}.png")
# combined.save(path)
# raise Exception(f"Slide {os.path.join(new_dir, name1)} difference is {diff} (limit is {threshold})")

if diff > threshold:
raise Exception(f"Slide {os.path.join(new_dir, name1)} difference is {diff} (limit is {threshold})")


def check(
Expand Down

0 comments on commit b761fe9

Please sign in to comment.