mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-15 11:56:28 +03:00
Skip Known Bad Tests
This commit is contained in:
parent
1ab78b8fb7
commit
a029e5da93
|
@ -123,6 +123,21 @@ class PillowTestCase(unittest.TestCase):
|
||||||
self.assertTrue(found)
|
self.assertTrue(found)
|
||||||
return result
|
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):
|
def tempfile(self, template):
|
||||||
assert template[:5] in ("temp.", "temp_")
|
assert template[:5] in ("temp.", "temp_")
|
||||||
(fd, path) = tempfile.mkstemp(template[4:], template[:4])
|
(fd, path) = tempfile.mkstemp(template[4:], template[:4])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user