From 08d491f0065b3eaba7d2bfe26024300d69fda81b Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sat, 5 Jul 2014 10:56:40 -0700 Subject: [PATCH] Skip known bad tests --- Tests/helper.py | 15 +++++++++++++++ Tests/test_file_palm.py | 1 + 2 files changed, 16 insertions(+) diff --git a/Tests/helper.py b/Tests/helper.py index 4a4cb3a28..7f0aaa73c 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -123,6 +123,21 @@ class PillowTestCase(unittest.TestCase): self.assertTrue(found) return result + def skipKnownBadTest(self, msg=None, platform=None, travis=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)): + print (os.environ.get('PILLOW_RUN_KNOWN_BAD', False)) + return + + skip = True + if platform is not None: + skip = sys.platform.startswith(platform) + if travis is not None: + skip = skip and (travis == bool(os.environ.get('TRAVIS',False))) + if skip: + self.skipTest(msg or "Known Bad Test") + def tempfile(self, template): assert template[:5] in ("temp.", "temp_") (fd, path) = tempfile.mkstemp(template[4:], template[:4]) diff --git a/Tests/test_file_palm.py b/Tests/test_file_palm.py index 95d89acb3..c1947ff37 100644 --- a/Tests/test_file_palm.py +++ b/Tests/test_file_palm.py @@ -44,6 +44,7 @@ class TestFilePalm(PillowTestCase): # Act / Assert self.helper_save_as_palm(mode) + self.skipKnownBadTest("Palm P image is wrong") self.roundtrip(mode) def test_rgb_ioerror(self):