Skip to content

Commit

Permalink
[2.2.x] Skipped GetImageDimensionsTests.test_webp when WEBP is not in…
Browse files Browse the repository at this point in the history
…stalled.

Bumped minimum Pillow version to 4.2.0 in test requirements.

Backport of fce389a from master
  • Loading branch information
felixxm committed Oct 6, 2020
1 parent 0f6e73e commit 657fea5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/internals/contributing/writing-code/unit-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ dependencies:
* geoip2_
* jinja2_ 2.7+
* numpy_
* Pillow_
* Pillow_ 4.2.0+
* PyYAML_
* pytz_ (required)
* pywatchman_
Expand Down
5 changes: 4 additions & 1 deletion tests/files/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
)

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

Expand Down Expand Up @@ -343,6 +345,7 @@ def test_valid_image(self):
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:
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements/py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docutils
geoip2 < 4.0.0
jinja2 >= 2.9.2
numpy
Pillow != 5.4.0
Pillow >=4.2.0, != 5.4.0
# pylibmc/libmemcached can't be built on Windows.
pylibmc; sys.platform != 'win32'
python-memcached >= 1.59
Expand Down

0 comments on commit 657fea5

Please sign in to comment.