diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 79a2b511f..1e7096ad8 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -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, diff --git a/Tests/test_imagefont_bitmap.py b/Tests/test_imagefont_bitmap.py index 784416a5f..e61bf2290 100644 --- a/Tests/test_imagefont_bitmap.py +++ b/Tests/test_imagefont_bitmap.py @@ -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)