From 1a61ab2f23bfc7461bfc30ff84bd43134f94d5c1 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 17 May 2018 16:10:01 +0300 Subject: [PATCH 1/4] AppVeyor: upgrade to PyPy 6.0.0 --- winbuild/appveyor_install_pypy.cmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winbuild/appveyor_install_pypy.cmd b/winbuild/appveyor_install_pypy.cmd index 1fe39f1a1..f68e75daa 100644 --- a/winbuild/appveyor_install_pypy.cmd +++ b/winbuild/appveyor_install_pypy.cmd @@ -1,3 +1,3 @@ -curl -fsSL -o pypy2.zip https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.10.0-win32.zip -7z x pypy2.zip -oc:\ -c:\Python34\Scripts\virtualenv.exe -p c:\pypy2-v5.10.0-win32\pypy.exe c:\vp\pypy2 +curl -fsSL -o pypy2.zip https://bitbucket.org/pypy/pypy/downloads/pypy2-v6.0.0-win32.zip +7z x pypy2.zip -oc:\ +c:\Python34\Scripts\virtualenv.exe -p c:\pypy2-v6.0.0-win32\pypy.exe c:\vp\pypy2 From 90ab677d44891550ba12383db8cd6ae124bd5230 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 17 May 2018 18:07:56 +0300 Subject: [PATCH 2/4] Re-enable test for PyPy --- Tests/test_imagedraw.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index a79a75ca0..a1b8fb19a 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -360,8 +360,6 @@ class TestImageDraw(PillowTestCase): ImageDraw.floodfill(im, (W, H), red) self.assert_image_equal(im, im_floodfill) - @unittest.skipIf(hasattr(sys, 'pypy_version_info'), - "Causes fatal RPython error on PyPy") def test_floodfill_border(self): # floodfill() is experimental From d524664215bbed37ee175a38b867958494684153 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 17 May 2018 21:42:20 +0300 Subject: [PATCH 3/4] Re-enable test for PyPy, we're long past 5.3.1 --- Tests/test_numpy.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Tests/test_numpy.py b/Tests/test_numpy.py index 3f9586513..4ccd35862 100644 --- a/Tests/test_numpy.py +++ b/Tests/test_numpy.py @@ -1,7 +1,6 @@ from __future__ import print_function -import sys -from helper import unittest, PillowTestCase, hopper +from helper import PillowTestCase, hopper, unittest from PIL import Image try: @@ -15,13 +14,6 @@ except ImportError: TEST_IMAGE_SIZE = (10, 10) -# Numpy on pypy as of pypy 5.3.1 is corrupting the numpy.array(Image) -# call such that it's returning a object of type numpy.ndarray, but -# the repr is that of a PIL.Image. Size and shape are 1 and (), not the -# size and shape of the array. This causes failures in several tests. -SKIP_NUMPY_ON_PYPY = hasattr(sys, 'pypy_version_info') and ( - sys.pypy_version_info <= (5, 3, 1, 'final', 0)) - class TestNumpy(PillowTestCase): @@ -121,7 +113,6 @@ class TestNumpy(PillowTestCase): for y in range(0, img.size[1], int(img.size[1]/10)): self.assert_deep_equal(px[x, y], np[y, x]) - @unittest.skipIf(SKIP_NUMPY_ON_PYPY, "numpy.array(Image) is flaky on PyPy") def test_16bit(self): img = Image.open('Tests/images/16bit.cropped.tif') np_img = numpy.array(img) @@ -152,7 +143,6 @@ class TestNumpy(PillowTestCase): img_px = img.load() self.assertEqual(img_px[0, 0], pixel_value) - @unittest.skipIf(SKIP_NUMPY_ON_PYPY, "numpy.array(Image) is flaky on PyPy") def test_to_array(self): def _to_array(mode, dtype): From 33592b4f73b25b420ea5395f4e936f1e0735cb7a Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 17 May 2018 23:21:47 +0300 Subject: [PATCH 4/4] No need to import sys --- Tests/test_imagedraw.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index a1b8fb19a..f9377634f 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -1,11 +1,7 @@ -from helper import unittest, PillowTestCase, hopper - -from PIL import Image -from PIL import ImageColor -from PIL import ImageDraw import os.path -import sys +from helper import PillowTestCase, hopper, unittest +from PIL import Image, ImageColor, ImageDraw BLACK = (0, 0, 0) WHITE = (255, 255, 255)