Skip test if FreeType is not available

This commit is contained in:
Andrew Murray 2026-04-05 12:57:01 +10:00
parent 64f6d4ebd8
commit 17612be407

View File

@ -2,6 +2,8 @@ from __future__ import annotations
from PIL import Image, ImageDraw, ImageFont
from .helper import skip_unless_feature
class TestFontCrash:
def _fuzz_font(self, font: ImageFont.FreeTypeFont) -> None:
@ -14,6 +16,7 @@ class TestFontCrash:
draw.multiline_textbbox((10, 10), "ABC\nAaaa", font, stroke_width=2)
draw.text((10, 10), "Test Text", font=font, fill="#000")
@skip_unless_feature("freetype")
def test_segfault(self) -> None:
font = ImageFont.truetype("Tests/fonts/fuzz_font-5203009437302784")
self._fuzz_font(font)