mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-27 12:33:41 +03:00
Lint fixes
This commit is contained in:
parent
983371d4d8
commit
25cf1010eb
|
@ -459,20 +459,25 @@ class TestImageFont(PillowTestCase):
|
||||||
with self.assertRaises(UnicodeEncodeError):
|
with self.assertRaises(UnicodeEncodeError):
|
||||||
font.getsize(u"’")
|
font.getsize(u"’")
|
||||||
|
|
||||||
@unittest.skipIf(sys.platform.startswith('win32') and sys.version.startswith('2'),
|
@unittest.skipIf(
|
||||||
"requires Python 3.x on Windows")
|
sys.platform.startswith("win32") and sys.version.startswith("2"),
|
||||||
|
"requires Python 3.x on Windows",
|
||||||
|
)
|
||||||
def test_unicode_extended(self):
|
def test_unicode_extended(self):
|
||||||
# issue #3777
|
# issue #3777
|
||||||
text = u"A\u278A\U0001F12B"
|
text = u"A\u278A\U0001F12B"
|
||||||
target = "Tests/images/unicode_extended.png"
|
target = "Tests/images/unicode_extended.png"
|
||||||
|
|
||||||
ttf = ImageFont.truetype("Tests/fonts/NotoSansSymbols-Regular.ttf",
|
ttf = ImageFont.truetype(
|
||||||
FONT_SIZE, layout_engine=self.LAYOUT_ENGINE)
|
"Tests/fonts/NotoSansSymbols-Regular.ttf",
|
||||||
|
FONT_SIZE,
|
||||||
|
layout_engine=self.LAYOUT_ENGINE,
|
||||||
|
)
|
||||||
img = Image.new("RGB", (100, 60))
|
img = Image.new("RGB", (100, 60))
|
||||||
d = ImageDraw.Draw(img)
|
d = ImageDraw.Draw(img)
|
||||||
d.text((10, 10), text, font=ttf)
|
d.text((10, 10), text, font=ttf)
|
||||||
|
|
||||||
self.assert_image_similar_tofile(img, target, self.metrics['multiline'])
|
self.assert_image_similar_tofile(img, target, self.metrics["multiline"])
|
||||||
|
|
||||||
def _test_fake_loading_font(self, path_to_fake, fontname):
|
def _test_fake_loading_font(self, path_to_fake, fontname):
|
||||||
# Make a copy of FreeTypeFont so we can patch the original
|
# Make a copy of FreeTypeFont so we can patch the original
|
||||||
|
|
Loading…
Reference in New Issue
Block a user