From 383f7130758578d14c02fee9b1e2c0b6069e7771 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Mon, 29 Sep 2014 16:36:09 -0700 Subject: [PATCH 1/3] Relax exact equals to approximate --- Tests/test_file_gimpgradient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/test_file_gimpgradient.py b/Tests/test_file_gimpgradient.py index c64deb79d..c54dca7c1 100644 --- a/Tests/test_file_gimpgradient.py +++ b/Tests/test_file_gimpgradient.py @@ -80,7 +80,7 @@ class TestImage(PillowTestCase): ret = GimpGradientFile.sphere_increasing(middle, pos) # Assert - self.assertEqual(ret, 0.9682458365518543) + self.assert_almost_equal(ret, 0.9682458365518543) def test_sphere_decreasing(self): # Arrange From 1a91078154a16a3c2d32a8858ace8c1e6aa697af Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Mon, 29 Sep 2014 22:14:26 -0700 Subject: [PATCH 2/3] Test failure explanation on PPC --- Tests/test_imagefile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py index 3556661ae..662a3bfb0 100644 --- a/Tests/test_imagefile.py +++ b/Tests/test_imagefile.py @@ -55,6 +55,12 @@ class TestImageFile(PillowTestCase): if EpsImagePlugin.has_ghostscript(): im1, im2 = roundtrip("EPS") + # This test fails on Ubuntu 12.04, PPC (Bigendian) It + # appears to be a ghostscript 9.05 bug, since the + # ghostscript rendering is wonky and the file is identical + # to that written on ubuntu 12.04 x64 + # md5sum: ba974835ff2d6f3f2fd0053a23521d4a + # EPS comes back in RGB: self.assert_image_similar(im1, im2.convert('L'), 20) From 1bb850427dca1a29156abb2580d6411b57966795 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Tue, 30 Sep 2014 08:33:29 -0700 Subject: [PATCH 3/3] Slightly relax imagedraw tests to pass on x86 --- Tests/test_imagedraw.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index ad0f33530..6adc6c1f2 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -63,8 +63,8 @@ class TestImageDraw(PillowTestCase): del draw # Assert - self.assert_image_equal( - im, Image.open("Tests/images/imagedraw_arc.png")) + self.assert_image_similar( + im, Image.open("Tests/images/imagedraw_arc.png"),1) def test_arc1(self): self.helper_arc(BBOX1) @@ -96,8 +96,8 @@ class TestImageDraw(PillowTestCase): del draw # Assert - self.assert_image_equal( - im, Image.open("Tests/images/imagedraw_chord.png")) + self.assert_image_similar( + im, Image.open("Tests/images/imagedraw_chord.png"),1) def test_chord1(self): self.helper_chord(BBOX1) @@ -115,8 +115,8 @@ class TestImageDraw(PillowTestCase): del draw # Assert - self.assert_image_equal( - im, Image.open("Tests/images/imagedraw_ellipse.png")) + self.assert_image_similar( + im, Image.open("Tests/images/imagedraw_ellipse.png"),1) def test_ellipse1(self): self.helper_ellipse(BBOX1) @@ -153,8 +153,8 @@ class TestImageDraw(PillowTestCase): del draw # Assert - self.assert_image_equal( - im, Image.open("Tests/images/imagedraw_pieslice.png")) + self.assert_image_similar( + im, Image.open("Tests/images/imagedraw_pieslice.png"),1) def test_pieslice1(self): self.helper_pieslice(BBOX1)