diff --git a/Tests/helper.py b/Tests/helper.py index 082fb93f9..3f7913b11 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -124,7 +124,8 @@ class PillowTestCase(unittest.TestCase): self.assertTrue(found) return result - def skipKnownBadTest(self, msg=None, platform=None, travis=None): + def skipKnownBadTest(self, msg=None, platform=None, + travis=None, interpreter=None): # Skip if platform/travis matches, and # PILLOW_RUN_KNOWN_BAD is not true in the environment. if bool(os.environ.get('PILLOW_RUN_KNOWN_BAD', False)): @@ -136,6 +137,8 @@ class PillowTestCase(unittest.TestCase): skip = sys.platform.startswith(platform) if travis is not None: skip = skip and (travis == bool(os.environ.get('TRAVIS', False))) + if interpreter is not None: + skip = skip and (interpreter == 'pypy' and hasattr(sys, 'pypy_version_info')) if skip: self.skipTest(msg or "Known Bad Test") diff --git a/Tests/test_image_point.py b/Tests/test_image_point.py index 7b6cd4fc7..aa134fcc6 100644 --- a/Tests/test_image_point.py +++ b/Tests/test_image_point.py @@ -5,12 +5,6 @@ import sys class TestImagePoint(PillowTestCase): - def setUp(self): - if hasattr(sys, 'pypy_version_info'): - # This takes _forever_ on PyPy. Open Bug, - # see https://github.com/python-pillow/Pillow/issues/484 - self.skipTest("Too slow on PyPy") - def test_sanity(self): im = lena() @@ -29,7 +23,10 @@ class TestImagePoint(PillowTestCase): def test_16bit_lut(self): """ Tests for 16 bit -> 8 bit lut for converting I->L images see https://github.com/python-pillow/Pillow/issues/440 - """ + """ + # This takes _forever_ on PyPy. Open Bug, + # see https://github.com/python-pillow/Pillow/issues/484 + self.skipKnownBadTest(msg="Too Slow on pypy", interpreter='pypy') im = lena("I") im.point(list(range(256))*256, 'L')