mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 00:46:16 +03:00
Simplify test skipping
This commit is contained in:
parent
da9a3dae63
commit
901c1e2aea
|
@ -5,18 +5,13 @@ from PIL import Image
|
|||
try:
|
||||
from PIL import _webp
|
||||
except ImportError:
|
||||
pass
|
||||
# Skip in setUp()
|
||||
_webp = None
|
||||
|
||||
|
||||
@unittest.skipIf(_webp is None, "WebP support not installed")
|
||||
class TestFileWebpAlpha(PillowTestCase):
|
||||
|
||||
def setUp(self):
|
||||
try:
|
||||
from PIL import _webp
|
||||
except ImportError:
|
||||
self.skipTest('WebP support not installed')
|
||||
|
||||
if _webp.WebPDecoderBuggyAlpha(self):
|
||||
self.skipTest("Buggy early version of WebP installed, "
|
||||
"not testing transparency")
|
||||
|
|
|
@ -18,11 +18,10 @@ except (OSError, ImportError) as v:
|
|||
TK_MODES = ('1', 'L', 'P', 'RGB', 'RGBA')
|
||||
|
||||
|
||||
@unittest.skipIf(not HAS_TK, "Tk not installed")
|
||||
class TestImageTk(PillowTestCase):
|
||||
|
||||
def setUp(self):
|
||||
if not HAS_TK:
|
||||
self.skipTest("Tk not installed")
|
||||
try:
|
||||
# setup tk
|
||||
tk.Frame()
|
||||
|
|
|
@ -8,9 +8,9 @@ except ImportError:
|
|||
pyroma = None
|
||||
|
||||
|
||||
@unittest.skipIf(pyroma is None, "Pyroma is not installed")
|
||||
class TestPyroma(PillowTestCase):
|
||||
|
||||
@unittest.skipUnless(pyroma, "Pyroma is not installed")
|
||||
def test_pyroma(self):
|
||||
# Arrange
|
||||
data = pyroma.projectdata.get_data(".")
|
||||
|
|
Loading…
Reference in New Issue
Block a user