Skip to content

Commit 7020dad

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

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/integration/utils.py

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

6363
mismatched_images.append(image_name)
6464

65+
diff_dir_actual_png = os.path.join(
66+
diff_dir, "{}_actual.png".format(image_name)
67+
)
68+
os.makedirs(os.path.dirname(diff_dir_actual_png), exist_ok=True)
6569
shutil.copy(
6670
path_to_actual_png,
67-
os.path.join(diff_dir, "{}_actual.png".format(image_name)),
71+
diff_dir_actual_png,
72+
)
73+
diff_dir_expected_png = os.path.join(
74+
diff_dir, "{}_expected.png".format(image_name)
6875
)
76+
os.makedirs(os.path.dirname(diff_dir_expected_png), exist_ok=True)
6977
shutil.copy(
7078
path_to_expected_png,
71-
os.path.join(diff_dir, "{}_expected.png".format(image_name)),
79+
diff_dir_expected_png,
7280
)
7381
# https://stackoverflow.com/questions/41405632/draw-a-rectangle-and-a-text-in-it-using-pil
7482
draw = ImageDraw.Draw(diff)

0 commit comments

Comments
 (0)