Merge pull request #2623 from radarhere/2585_debug_fix

Removed debugging code
This commit is contained in:
Hugo 2017-07-16 09:16:26 +02:00 committed by GitHub
commit 5bd8cdfe5c

View File

@ -63,11 +63,11 @@ class TestImageFont(PillowTestCase):
def setUp(self): def setUp(self):
freetype_version = tuple(ImageFont.core.freetype2_version.split('.'))[:2] freetype_version = tuple(ImageFont.core.freetype2_version.split('.'))[:2]
self.metrics = self.METRICS.get(freetype_version, self.METRICS['Default']) self.metrics = self.METRICS.get(freetype_version, self.METRICS['Default'])
def get_font(self): def get_font(self):
return ImageFont.truetype(FONT_PATH, FONT_SIZE, return ImageFont.truetype(FONT_PATH, FONT_SIZE,
layout_engine=self.LAYOUT_ENGINE) layout_engine=self.LAYOUT_ENGINE)
def test_sanity(self): def test_sanity(self):
self.assertRegexpMatches( self.assertRegexpMatches(
ImageFont.core.freetype2_version, r"\d+\.\d+\.\d+$") ImageFont.core.freetype2_version, r"\d+\.\d+\.\d+$")
@ -248,9 +248,7 @@ class TestImageFont(PillowTestCase):
target = 'Tests/images/multiline_text_spacing.png' target = 'Tests/images/multiline_text_spacing.png'
target_img = Image.open(target) target_img = Image.open(target)
from PIL import ImageChops
ImageChops.difference(im, target_img).save('multiline.png')
# Epsilon ~.5 fails with FreeType 2.7 # Epsilon ~.5 fails with FreeType 2.7
self.assert_image_similar(im, target_img, self.metrics['multiline']) self.assert_image_similar(im, target_img, self.metrics['multiline'])