skip test_only_save_relevant_sizes test with pypy 5.4.1

This commit is contained in:
Fahad Al-Saidi 2016-12-15 10:43:29 +04:00
parent 5bdb95783f
commit 2957993730

View File

@ -1,8 +1,14 @@
from helper import unittest, PillowTestCase, hopper from helper import unittest, PillowTestCase, hopper
import io import io
import sys
from PIL import Image, IcoImagePlugin from PIL import Image, IcoImagePlugin
# The the default version of PyPy in Trusty is PyPy 5.4.1.
# There is a known error in it: TypeError: PyPy does not yet implement the new buffer interface (issue #2163).
SKIP_5_4_1_PYPY = hasattr(sys, 'pypy_version_info') and (
sys.pypy_version_info >= (5, 4, 1, 'final', 0))
# sample ppm stream # sample ppm stream
TEST_ICO_FILE = "Tests/images/hopper.ico" TEST_ICO_FILE = "Tests/images/hopper.ico"
@ -61,6 +67,7 @@ class TestFileIco(PillowTestCase):
# Assert # Assert
self.assertEqual(im_saved.size, (256, 256)) self.assertEqual(im_saved.size, (256, 256))
@unittest.skipIf(SKIP_5_4_1_PYPY, "PyPy does not yet implement the new buffer interface")
def test_only_save_relevant_sizes(self): def test_only_save_relevant_sizes(self):
"""Issue #2266 https://github.com/python-pillow/Pillow/issues/2266 """Issue #2266 https://github.com/python-pillow/Pillow/issues/2266
Should save in 16x16, 24x24, 32x32, 48x48 sizes Should save in 16x16, 24x24, 32x32, 48x48 sizes