Skip to content

Commit 331e4e7

Browse files
authored
Merge pull request #8482 from radarhere/imagefile
2 parents d59b169 + a337138 commit 331e4e7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Tests/test_image_resize.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import pytest
1212

13-
from PIL import Image
13+
from PIL import Image, ImageFile
1414

1515
from .helper import (
1616
assert_image_equal,
@@ -179,7 +179,7 @@ def test_cross_platform(self, tmp_path: Path) -> None:
179179

180180

181181
@pytest.fixture
182-
def gradients_image() -> Generator[Image.Image, None, None]:
182+
def gradients_image() -> Generator[ImageFile.ImageFile, None, None]:
183183
with Image.open("Tests/images/radial_gradients.png") as im:
184184
im.load()
185185
try:
@@ -189,7 +189,7 @@ def gradients_image() -> Generator[Image.Image, None, None]:
189189

190190

191191
class TestReducingGapResize:
192-
def test_reducing_gap_values(self, gradients_image: Image.Image) -> None:
192+
def test_reducing_gap_values(self, gradients_image: ImageFile.ImageFile) -> None:
193193
ref = gradients_image.resize(
194194
(52, 34), Image.Resampling.BICUBIC, reducing_gap=None
195195
)
@@ -210,7 +210,7 @@ def test_reducing_gap_values(self, gradients_image: Image.Image) -> None:
210210
)
211211
def test_reducing_gap_1(
212212
self,
213-
gradients_image: Image.Image,
213+
gradients_image: ImageFile.ImageFile,
214214
box: tuple[float, float, float, float],
215215
epsilon: float,
216216
) -> None:
@@ -230,7 +230,7 @@ def test_reducing_gap_1(
230230
)
231231
def test_reducing_gap_2(
232232
self,
233-
gradients_image: Image.Image,
233+
gradients_image: ImageFile.ImageFile,
234234
box: tuple[float, float, float, float],
235235
epsilon: float,
236236
) -> None:
@@ -250,7 +250,7 @@ def test_reducing_gap_2(
250250
)
251251
def test_reducing_gap_3(
252252
self,
253-
gradients_image: Image.Image,
253+
gradients_image: ImageFile.ImageFile,
254254
box: tuple[float, float, float, float],
255255
epsilon: float,
256256
) -> None:
@@ -266,7 +266,9 @@ def test_reducing_gap_3(
266266

267267
@pytest.mark.parametrize("box", (None, (1.1, 2.2, 510.8, 510.9), (3, 10, 410, 256)))
268268
def test_reducing_gap_8(
269-
self, gradients_image: Image.Image, box: tuple[float, float, float, float]
269+
self,
270+
gradients_image: ImageFile.ImageFile,
271+
box: tuple[float, float, float, float],
270272
) -> None:
271273
ref = gradients_image.resize((52, 34), Image.Resampling.BICUBIC, box=box)
272274
im = gradients_image.resize(
@@ -281,7 +283,7 @@ def test_reducing_gap_8(
281283
)
282284
def test_box_filter(
283285
self,
284-
gradients_image: Image.Image,
286+
gradients_image: ImageFile.ImageFile,
285287
box: tuple[float, float, float, float],
286288
epsilon: float,
287289
) -> None:

0 commit comments

Comments
 (0)