From 44e784a95e4af1dff6c2925f2ceb397f30852b84 Mon Sep 17 00:00:00 2001 From: Fahad Al-Saidi Date: Thu, 15 Dec 2016 10:04:17 +0400 Subject: [PATCH] skip test_jp2_icon test when use PyPy 5.4.1 --- Tests/test_file_icns.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/test_file_icns.py b/Tests/test_file_icns.py index 92fe136f2..376124d19 100644 --- a/Tests/test_file_icns.py +++ b/Tests/test_file_icns.py @@ -4,6 +4,12 @@ from PIL import Image import sys +# 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 icon file TEST_FILE = "Tests/images/pillow.icns" @@ -61,6 +67,7 @@ class TestFileIcns(PillowTestCase): self.assertEqual(im2.mode, 'RGBA') self.assertEqual(im2.size, (wr, hr)) + @unittest.skipIf(SKIP_5_4_1_PYPY, "PyPy does not yet implement the new buffer interface") def test_jp2_icon(self): # This icon was made by using Uli Kusterer's oldiconutil to replace # the PNG images with JPEG 2000 ones. The advantage of doing this is