diff --git a/Tests/helper.py b/Tests/helper.py index feccce6bc..13c6955e4 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -324,7 +324,7 @@ def is_mingw(): return sysconfig.get_platform() == "mingw" -class cached_property: +class CachedProperty: def __init__(self, func): self.func = func diff --git a/Tests/test_image_paste.py b/Tests/test_image_paste.py index 281d5a6fb..4ea1d73ce 100644 --- a/Tests/test_image_paste.py +++ b/Tests/test_image_paste.py @@ -1,6 +1,6 @@ from PIL import Image -from .helper import assert_image_equal, cached_property +from .helper import CachedProperty, assert_image_equal class TestImagingPaste: @@ -34,7 +34,7 @@ class TestImagingPaste: im.paste(im2, mask) self.assert_9points_image(im, expected) - @cached_property + @CachedProperty def mask_1(self): mask = Image.new("1", (self.size, self.size)) px = mask.load() @@ -43,11 +43,11 @@ class TestImagingPaste: px[y, x] = (x + y) % 2 return mask - @cached_property + @CachedProperty def mask_L(self): return self.gradient_L.transpose(Image.Transpose.ROTATE_270) - @cached_property + @CachedProperty def gradient_L(self): gradient = Image.new("L", (self.size, self.size)) px = gradient.load() @@ -56,7 +56,7 @@ class TestImagingPaste: px[y, x] = (x + y) % 255 return gradient - @cached_property + @CachedProperty def gradient_RGB(self): return Image.merge( "RGB", @@ -67,7 +67,7 @@ class TestImagingPaste: ], ) - @cached_property + @CachedProperty def gradient_LA(self): return Image.merge( "LA", @@ -77,7 +77,7 @@ class TestImagingPaste: ], ) - @cached_property + @CachedProperty def gradient_RGBA(self): return Image.merge( "RGBA", @@ -89,7 +89,7 @@ class TestImagingPaste: ], ) - @cached_property + @CachedProperty def gradient_RGBa(self): return Image.merge( "RGBa", diff --git a/Tests/test_imagepath.py b/Tests/test_imagepath.py index e38a2068a..de3920cf5 100644 --- a/Tests/test_imagepath.py +++ b/Tests/test_imagepath.py @@ -174,7 +174,7 @@ def test_overflow_segfault(): # through to the sequence. Seeing this on 32-bit Windows. with pytest.raises((TypeError, MemoryError)): # post patch, this fails with a memory error - x = evil() + x = Evil() # This fails due to the invalid malloc above, # and segfaults @@ -182,7 +182,7 @@ def test_overflow_segfault(): x[i] = b"0" * 16 -class evil: +class Evil: def __init__(self): self.corrupt = Image.core.path(0x4000000000000000)