Skip to content

Commit b4b296f

Browse files
committed
Fix dir issues in comparing images
1 parent f759fdc commit b4b296f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/integration/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,17 @@ def compare_images(
6262

6363
mismatched_images.append(image_name)
6464

65+
actual_dir = os.path.join(diff_dir, "{}_actual.png".format(image_name))
66+
os.makedirs(os.path.dirname(actual_dir), exist_ok=True)
6567
shutil.copy(
6668
path_to_actual_png,
67-
os.path.join(diff_dir, "{}_actual.png".format(image_name)),
69+
actual_dir,
6870
)
71+
expected_dir = os.path.join(diff_dir, "{}_expected.png".format(image_name))
72+
os.makedirs(os.path.dirname(expected_dir), exist_ok=True)
6973
shutil.copy(
7074
path_to_expected_png,
71-
os.path.join(diff_dir, "{}_expected.png".format(image_name)),
75+
expected_dir,
7276
)
7377
# https://stackoverflow.com/questions/41405632/draw-a-rectangle-and-a-text-in-it-using-pil
7478
draw = ImageDraw.Draw(diff)

0 commit comments

Comments
 (0)