From 006de79d60ad3a1d9f874a08726204ff5f013146 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 20 Mar 2021 22:42:10 +1100 Subject: [PATCH] Use assert_image_equal_tofile --- Tests/test_imagedraw.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index 0faf304a8..8d6195b27 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -1352,19 +1352,18 @@ def test_compute_regular_polygon_vertices_input_error_handling( def test_continuous_horizontal_edges_polygon(): - with Image.open( - os.path.join(IMAGES_PATH, "continuous_horizontal_edges_polygon.png") - ) as expected: - expected.load() - xy = [ - (2, 6), - (12, 6), - (12, 12), - (8, 12), - (8, 8), - (4, 8), - (2, 8), - ] - img, draw = create_base_image_draw((16, 16)) - draw.polygon(xy, BLACK) - assert_image_equal(img, expected, "continuous horizontal edges polygon failed") + xy = [ + (2, 6), + (12, 6), + (12, 12), + (8, 12), + (8, 8), + (4, 8), + (2, 8), + ] + img, draw = create_base_image_draw((16, 16)) + draw.polygon(xy, BLACK) + expected = os.path.join(IMAGES_PATH, "continuous_horizontal_edges_polygon.png") + assert_image_equal_tofile( + img, expected, "continuous horizontal edges polygon failed" + )