Merge pull request #7351 from radarhere/freetype_tests

This commit is contained in:
Hugo van Kemenade 2023-08-24 14:20:26 -06:00 committed by GitHub
commit 643a52a2eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import packaging
import pytest import pytest
from PIL import Image, features from PIL import Image, features
from Tests.helper import skip_unless_feature
if sys.platform.startswith("win32"): if sys.platform.startswith("win32"):
pytest.skip("Fuzzer is linux only", allow_module_level=True) pytest.skip("Fuzzer is linux only", allow_module_level=True)
@ -48,6 +49,7 @@ def test_fuzz_images(path):
fuzzers.disable_decompressionbomb_error() fuzzers.disable_decompressionbomb_error()
@skip_unless_feature("freetype2")
@pytest.mark.parametrize( @pytest.mark.parametrize(
"path", subprocess.check_output("find Tests/fonts -type f", shell=True).split(b"\n") "path", subprocess.check_output("find Tests/fonts -type f", shell=True).split(b"\n")
) )

View File

@ -1326,6 +1326,7 @@ def test_stroke_multiline():
assert_image_similar_tofile(im, "Tests/images/imagedraw_stroke_multiline.png", 3.3) assert_image_similar_tofile(im, "Tests/images/imagedraw_stroke_multiline.png", 3.3)
@skip_unless_feature("freetype2")
def test_setting_default_font(): def test_setting_default_font():
# Arrange # Arrange
im = Image.new("RGB", (100, 250)) im = Image.new("RGB", (100, 250))

View File

@ -112,6 +112,7 @@ def helper_assert_pickled_font_images(font1, font2):
assert_image_equal(im1, im2) assert_image_equal(im1, im2)
@skip_unless_feature("freetype2")
@pytest.mark.parametrize("protocol", list(range(0, pickle.HIGHEST_PROTOCOL + 1))) @pytest.mark.parametrize("protocol", list(range(0, pickle.HIGHEST_PROTOCOL + 1)))
def test_pickle_font_string(protocol): def test_pickle_font_string(protocol):
# Arrange # Arrange
@ -125,6 +126,7 @@ def test_pickle_font_string(protocol):
helper_assert_pickled_font_images(font, unpickled_font) helper_assert_pickled_font_images(font, unpickled_font)
@skip_unless_feature("freetype2")
@pytest.mark.parametrize("protocol", list(range(0, pickle.HIGHEST_PROTOCOL + 1))) @pytest.mark.parametrize("protocol", list(range(0, pickle.HIGHEST_PROTOCOL + 1)))
def test_pickle_font_file(tmp_path, protocol): def test_pickle_font_file(tmp_path, protocol):
# Arrange # Arrange