mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Merge pull request #4295 from radarhere/test_fixes
Improved unittest conditions
This commit is contained in:
commit
4f6472ff0d
|
@ -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 = (
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -2,10 +2,9 @@ import unittest
|
|||
|
||||
from PIL import Image, ImageDraw, ImageFont, features
|
||||
|
||||
from .helper import PillowLeakTestCase, is_win32
|
||||
from .helper import PillowLeakTestCase
|
||||
|
||||
|
||||
@unittest.skipIf(is_win32(), "requires Unix or macOS")
|
||||
class TestTTypeFontLeak(PillowLeakTestCase):
|
||||
# fails at iteration 3 in master
|
||||
iterations = 10
|
||||
|
@ -20,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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user