Skip to content

Commit

Permalink
Fix dir issues in comparing images
Browse files Browse the repository at this point in the history
  • Loading branch information
forsyth2 committed Oct 28, 2024
1 parent f759fdc commit b4b296f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/integration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ def compare_images(

mismatched_images.append(image_name)

actual_dir = os.path.join(diff_dir, "{}_actual.png".format(image_name))
os.makedirs(os.path.dirname(actual_dir), exist_ok=True)
shutil.copy(
path_to_actual_png,
os.path.join(diff_dir, "{}_actual.png".format(image_name)),
actual_dir,
)
expected_dir = os.path.join(diff_dir, "{}_expected.png".format(image_name))
os.makedirs(os.path.dirname(expected_dir), exist_ok=True)
shutil.copy(
path_to_expected_png,
os.path.join(diff_dir, "{}_expected.png".format(image_name)),
expected_dir,
)
# https://stackoverflow.com/questions/41405632/draw-a-rectangle-and-a-text-in-it-using-pil
draw = ImageDraw.Draw(diff)
Expand Down

0 comments on commit b4b296f

Please sign in to comment.