mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 21:50:54 +03:00
Corrected check for BuiltinFilter
This commit is contained in:
parent
51c577df82
commit
07be6fca17
|
@ -36,9 +36,14 @@ from .helper import assert_image_equal, hopper
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@pytest.mark.parametrize("mode", ("L", "I", "RGB", "CMYK"))
|
@pytest.mark.parametrize("mode", ("L", "I", "RGB", "CMYK"))
|
||||||
def test_sanity(filter_to_apply: ImageFilter.Filter, mode: str) -> None:
|
def test_sanity(
|
||||||
|
filter_to_apply: ImageFilter.Filter | type[ImageFilter.Filter], mode: str
|
||||||
|
) -> None:
|
||||||
im = hopper(mode)
|
im = hopper(mode)
|
||||||
if mode != "I" or isinstance(filter_to_apply, ImageFilter.BuiltinFilter):
|
if mode != "I" or (
|
||||||
|
callable(filter_to_apply)
|
||||||
|
and issubclass(filter_to_apply, ImageFilter.BuiltinFilter)
|
||||||
|
):
|
||||||
out = im.filter(filter_to_apply)
|
out = im.filter(filter_to_apply)
|
||||||
assert out.mode == im.mode
|
assert out.mode == im.mode
|
||||||
assert out.size == im.size
|
assert out.size == im.size
|
||||||
|
|
Loading…
Reference in New Issue
Block a user