Merge pull request #3423 from hugovk/fix-feature-tests

Fix some tests
This commit is contained in:
Andrew Murray 2018-10-22 08:53:26 +11:00 committed by GitHub
commit 94925c5057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 20 deletions

View File

@ -23,20 +23,20 @@ class TestFeatures(PillowTestCase):
self.assertEqual(features.check_feature(feature),
features.check(feature))
@unittest.skipUnless(HAVE_WEBP, True)
def check_webp_transparency(self):
@unittest.skipUnless(HAVE_WEBP, "WebP not available")
def test_webp_transparency(self):
self.assertEqual(features.check('transp_webp'),
not _webp.WebPDecoderBuggyAlpha())
self.assertEqual(features.check('transp_webp'),
_webp.HAVE_TRANSPARENCY)
@unittest.skipUnless(HAVE_WEBP, True)
def check_webp_mux(self):
@unittest.skipUnless(HAVE_WEBP, "WebP not available")
def test_webp_mux(self):
self.assertEqual(features.check('webp_mux'),
_webp.HAVE_WEBPMUX)
@unittest.skipUnless(HAVE_WEBP, True)
def check_webp_anim(self):
@unittest.skipUnless(HAVE_WEBP, "WebP not available")
def test_webp_anim(self):
self.assertEqual(features.check('webp_anim'),
_webp.HAVE_WEBPANIM)

View File

@ -13,15 +13,11 @@ class TestFormatHSV(PillowTestCase):
return float(i)/255.0
def str_to_float(self, i):
return float(ord(i))/255.0
def to_int(self, f):
return int(f*255.0)
def tuple_to_ints(self, tp):
x, y, z = tp
return (int(x*255.0), int(y*255.0), int(z*255.0))
return int(x*255.0), int(y*255.0), int(z*255.0)
def test_sanity(self):
Image.new('HSV', (100, 100))

View File

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