diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-10-06 11:25:04 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-10-06 11:32:34 +0200 |
| commit | 657fea55cbec215031336112a3efa356b6e9d952 (patch) | |
| tree | f66d2ebc98068927bf40935a363892eed9eb38aa /tests/files/tests.py | |
| parent | 0f6e73e567face1da65e936ce67ad3c01822bd43 (diff) | |
[2.2.x] Skipped GetImageDimensionsTests.test_webp when WEBP is not installed.
Bumped minimum Pillow version to 4.2.0 in test requirements.
Backport of fce389af7cf95151118c9fc7cafd777a31f94946 from master
Diffstat (limited to 'tests/files/tests.py')
| -rw-r--r-- | tests/files/tests.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/files/tests.py b/tests/files/tests.py index b50061649a..c60d69bf6a 100644 --- a/tests/files/tests.py +++ b/tests/files/tests.py @@ -17,9 +17,11 @@ from django.core.files.uploadedfile import ( ) try: - from PIL import Image + from PIL import Image, features + HAS_WEBP = features.check('webp') except ImportError: Image = None + HAS_WEBP = False else: from django.core.files import images @@ -343,6 +345,7 @@ class GetImageDimensionsTests(unittest.TestCase): size = images.get_image_dimensions(fh) self.assertEqual(size, (None, None)) + @unittest.skipUnless(HAS_WEBP, 'WEBP not installed') def test_webp(self): img_path = os.path.join(os.path.dirname(__file__), 'test.webp') with open(img_path, 'rb') as fh: |
