From 7859f81828543c2c78c028a2798cf5704760d146 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 23 Mar 2020 07:05:40 +1100 Subject: [PATCH] Use pytest to skip tests --- Tests/test_imagefont.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 690f624d3..b3686aea1 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -3,7 +3,6 @@ import distutils.version import os import re import shutil -import unittest from io import BytesIO from unittest import mock @@ -441,7 +440,7 @@ class TestImageFont(PillowTestCase): with pytest.raises(UnicodeEncodeError): font.getsize("’") - @unittest.skipIf(is_pypy(), "failing on PyPy") + @pytest.mark.skipif(is_pypy(), reason="failing on PyPy") def test_unicode_extended(self): # issue #3777 text = "A\u278A\U0001F12B" @@ -478,7 +477,7 @@ class TestImageFont(PillowTestCase): name = font.getname() assert ("FreeMono", "Regular") == name - @unittest.skipIf(is_win32(), "requires Unix or macOS") + @pytest.mark.skipif(is_win32(), reason="requires Unix or macOS") def test_find_linux_font(self): # A lot of mocking here - this is more for hitting code and # catching syntax like errors @@ -523,7 +522,7 @@ class TestImageFont(PillowTestCase): font_directory + "/Duplicate.ttf", "Duplicate" ) - @unittest.skipIf(is_win32(), "requires Unix or macOS") + @pytest.mark.skipif(is_win32(), reason="requires Unix or macOS") def test_find_macos_font(self): # Like the linux test, more cover hitting code rather than testing # correctness.