Skip known bad tests

This commit is contained in:
wiredfool 2014-07-05 10:56:40 -07:00
parent cedd8c2106
commit 08d491f006
2 changed files with 16 additions and 0 deletions

View File

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

View File

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