Skip to content

Commit 9e9f960

Browse files
committed
tests: additionally disable test_read_region_2GB on Pillow < 6.2.0
Older versions of Pillow raise "MemoryError: Integer overflow in ysize" when Image.frombuffer() is called on large buffers. The test is unconditionally disabled because of its RAM usage, so this is mostly documentation. See #31. Closes #33.
1 parent 0463cc1 commit 9e9f960

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_openslide.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,11 @@ def test_read_region_bad_size(self):
125125
lambda: self.osr.read_region((0, 0), 1, (400, -5)))
126126

127127
@skip_if(sys.maxsize < 1 << 32, '32-bit Python')
128-
# Also skips Pillow < 2.1.0
129-
@skip_if(have_optimizations and not hasattr(Image, 'PILLOW_VERSION'),
130-
'broken on PIL')
128+
# Broken on PIL and on Pillow >= 3.4.0, < 6.2.0.
129+
# https://github.com/python-pillow/Pillow/issues/3963
130+
@skip_if(have_optimizations and
131+
[int(i) for i in getattr(Image, '__version__', '0').split('.')] < [6,2,0],
132+
'broken on PIL and Pillow < 6.2.0')
131133
# Disabled to avoid OOM killer on small systems, since the stdlib
132134
# doesn't provide a way to find out how much RAM we have
133135
def _test_read_region_2GB(self):

0 commit comments

Comments
 (0)