mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
fix tests
This commit is contained in:
parent
bf529303de
commit
28d313305a
|
@ -852,11 +852,9 @@ class TestImageFont:
|
|||
with Image.open("Tests/images/standard_embedded.png") as expected:
|
||||
assert_image_similar(img, expected, max(self.metrics["multiline"], 3))
|
||||
|
||||
@pytest.mark.skipif(
|
||||
parse_version(features.version_module("freetype2")) < parse_version("2.5.0"),
|
||||
reason="Freetype 2.5.0 or newer required",
|
||||
)
|
||||
def test_cbdt(self):
|
||||
if parse_version(features.version_module("freetype2")) < parse_version("2.5.0"):
|
||||
pytest.skip("Freetype 2.5.0 or newer required")
|
||||
try:
|
||||
font = ImageFont.truetype(
|
||||
"Tests/fonts/NotoColorEmoji.ttf",
|
||||
|
@ -875,11 +873,9 @@ class TestImageFont:
|
|||
assert str(ex) in ("unimplemented feature", "unknown file format")
|
||||
pytest.skip("freetype compiled without libpng or unsupported")
|
||||
|
||||
@pytest.mark.skipif(
|
||||
parse_version(features.version_module("freetype2")) < parse_version("2.5.0"),
|
||||
reason="Freetype 2.5.0 or newer required",
|
||||
)
|
||||
def test_cbdt_mask(self):
|
||||
if parse_version(features.version_module("freetype2")) < parse_version("2.5.0"):
|
||||
pytest.skip("Freetype 2.5.0 or newer required")
|
||||
try:
|
||||
font = ImageFont.truetype(
|
||||
"Tests/fonts/NotoColorEmoji.ttf",
|
||||
|
@ -898,11 +894,12 @@ class TestImageFont:
|
|||
assert str(ex) in ("unimplemented feature", "unknown file format")
|
||||
pytest.skip("freetype compiled without libpng or unsupported")
|
||||
|
||||
@pytest.mark.skipif(
|
||||
parse_version(features.version_module("freetype2")) < parse_version("2.10.0"),
|
||||
reason="Freetype 2.10.0 or newer required",
|
||||
)
|
||||
def test_colr(self):
|
||||
if parse_version(features.version_module("freetype2")) < parse_version(
|
||||
"2.10.0"
|
||||
):
|
||||
pytest.skip("Freetype 2.10.0 or newer required")
|
||||
|
||||
font = ImageFont.truetype(
|
||||
"Tests/fonts/BungeeColor-Regular_colr_Windows.ttf",
|
||||
size=64,
|
||||
|
@ -917,11 +914,12 @@ class TestImageFont:
|
|||
with Image.open("Tests/images/colr_bungee.png") as expected:
|
||||
assert_image_similar(im, expected, 21)
|
||||
|
||||
@pytest.mark.skipif(
|
||||
parse_version(features.version_module("freetype2")) < parse_version("2.10.0"),
|
||||
reason="Freetype 2.10.0 or newer required",
|
||||
)
|
||||
def test_colr_mask(self):
|
||||
if parse_version(features.version_module("freetype2")) < parse_version(
|
||||
"2.10.0"
|
||||
):
|
||||
pytest.skip("Freetype 2.10.0 or newer required")
|
||||
|
||||
font = ImageFont.truetype(
|
||||
"Tests/fonts/BungeeColor-Regular_colr_Windows.ttf",
|
||||
size=64,
|
||||
|
|
|
@ -40,4 +40,4 @@ def test_similar():
|
|||
fill=(0, 0, 0),
|
||||
font=font_outline,
|
||||
)
|
||||
assert_image_similar(im_bitmap, im_outline, 44)
|
||||
assert_image_similar(im_bitmap, im_outline, 4)
|
||||
|
|
Loading…
Reference in New Issue
Block a user