mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 05:34:36 +03:00
Restored testing of non-TrueType default font
This commit is contained in:
parent
1185fb8296
commit
8caae8739f
|
@ -1,8 +1,10 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from PIL import Image, ImageDraw, ImageFont
|
from PIL import Image, ImageDraw, ImageFont, _util
|
||||||
|
|
||||||
from .helper import PillowLeakTestCase, skip_unless_feature
|
from .helper import PillowLeakTestCase, features, skip_unless_feature
|
||||||
|
|
||||||
|
original_core = ImageFont.core
|
||||||
|
|
||||||
|
|
||||||
class TestTTypeFontLeak(PillowLeakTestCase):
|
class TestTTypeFontLeak(PillowLeakTestCase):
|
||||||
|
@ -31,5 +33,9 @@ class TestDefaultFontLeak(TestTTypeFontLeak):
|
||||||
mem_limit = 1024 # k
|
mem_limit = 1024 # k
|
||||||
|
|
||||||
def test_leak(self):
|
def test_leak(self):
|
||||||
|
if features.check_module("freetype2"):
|
||||||
|
ImageFont.core = _util.DeferredError(ImportError)
|
||||||
default_font = ImageFont.load_default()
|
default_font = ImageFont.load_default()
|
||||||
|
ImageFont.core = original_core
|
||||||
|
|
||||||
self._test_font(default_font)
|
self._test_font(default_font)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user