Simplify skipping

This commit is contained in:
Hugo 2018-10-21 17:47:35 +03:00
parent e33812c56c
commit 06ad343d35

View File

@ -5,19 +5,12 @@ from PIL import __version__
try: try:
import pyroma import pyroma
except ImportError: except ImportError:
# Skip via setUp() pyroma = None
pass
class TestPyroma(PillowTestCase): class TestPyroma(PillowTestCase):
def setUp(self): @unittest.skipUnless(pyroma, "Pyroma is not installed")
try:
import pyroma
assert pyroma # Ignore warning
except ImportError:
self.skipTest("ImportError")
def test_pyroma(self): def test_pyroma(self):
# Arrange # Arrange
data = pyroma.projectdata.get_data(".") data = pyroma.projectdata.get_data(".")