Skip to content

Commit 6f939ae

Browse files
committed
tests: Skip large-read test with extension module on PIL
PIL.Image.frombuffer() raises a ValueError, "buffer has negative size". PIL is ancient and large reads are unusual, so this isn't worth fixing.
1 parent af68792 commit 6f939ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_openslide.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ctypes import ArgumentError
2121
from openslide import (OpenSlide, OpenSlideError,
2222
OpenSlideUnsupportedFormatError)
23+
from PIL import Image
2324
import re
2425
import sys
2526
import unittest
@@ -122,6 +123,8 @@ def test_read_region_bad_size(self):
122123
lambda: self.osr.read_region((0, 0), 1, (400, -5)))
123124

124125
@skip_if(sys.maxsize < 1 << 32, '32-bit Python')
126+
@skip_if(have_optimizations and not hasattr(Image, 'PILLOW_VERSION'),
127+
'broken on PIL')
125128
def test_read_region_2GB(self):
126129
self.assertEqual(
127130
self.osr.read_region((1000, 1000), 0, (32768, 16384)).size,

0 commit comments

Comments
 (0)