Simplified conditions

This commit is contained in:
Andrew Murray 2019-12-25 14:13:16 +11:00
parent 9a72ad4fa9
commit 666b726626
7 changed files with 7 additions and 7 deletions

View File

@ -49,7 +49,7 @@ class TestFileMsp(PillowTestCase):
with Image.open(target_path) as target:
self.assert_image_equal(im, target)
@unittest.skipIf(not os.path.exists(EXTRA_DIR), "Extra image files not installed")
@unittest.skipUnless(os.path.exists(EXTRA_DIR), "Extra image files not installed")
def test_open_windows_v2(self):
files = (

View File

@ -30,7 +30,7 @@ class TestFileSun(PillowTestCase):
with Image.open("Tests/images/sunraster.im1.png") as target:
self.assert_image_equal(im, target)
@unittest.skipIf(not os.path.exists(EXTRA_DIR), "Extra image files not installed")
@unittest.skipUnless(os.path.exists(EXTRA_DIR), "Extra image files not installed")
def test_others(self):
files = (
os.path.join(EXTRA_DIR, f)

View File

@ -26,7 +26,7 @@ class TestUnsupportedWebp(PillowTestCase):
WebPImagePlugin.SUPPORTED = True
@unittest.skipIf(not HAVE_WEBP, "WebP support not installed")
@unittest.skipUnless(HAVE_WEBP, "WebP support not installed")
class TestFileWebp(PillowTestCase):
def setUp(self):
self.rgb_mode = "RGB"

View File

@ -19,7 +19,7 @@ class TestTTypeFontLeak(PillowLeakTestCase):
)
)
@unittest.skipIf(not features.check("freetype2"), "Test requires freetype2")
@unittest.skipUnless(features.check("freetype2"), "Test requires freetype2")
def test_leak(self):
ttype = ImageFont.truetype("Tests/fonts/FreeMono.ttf", 20)
self._test_font(ttype)

View File

@ -11,7 +11,7 @@ except ImportError:
image_font_installed = False
@unittest.skipIf(not image_font_installed, "image font not installed")
@unittest.skipUnless(image_font_installed, "image font not installed")
class TestImageFontBitmap(PillowTestCase):
def test_similar(self):
text = "EmbeddedBitmap"

View File

@ -18,7 +18,7 @@ except (OSError, ImportError):
TK_MODES = ("1", "L", "P", "RGB", "RGBA")
@unittest.skipIf(not HAS_TK, "Tk not installed")
@unittest.skipUnless(HAS_TK, "Tk not installed")
class TestImageTk(PillowTestCase):
def setUp(self):
try:

View File

@ -16,7 +16,7 @@ class TestUtil(PillowTestCase):
# Assert
self.assertTrue(it_is)
@unittest.skipIf(not _util.py36, "os.path support for Paths added in 3.6")
@unittest.skipUnless(_util.py36, "os.path support for Paths added in 3.6")
def test_path_obj_is_path(self):
# Arrange
from pathlib import Path