Re-enable test for PyPy, we're long past 5.3.1

This commit is contained in:
Hugo 2018-05-17 21:42:20 +03:00
parent 90ab677d44
commit d524664215

View File

@ -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):