mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-23 15:20:33 +03:00
Test opening file with plugin directly
This commit is contained in:
parent
1496d87d3a
commit
dc94d1d8bb
|
@ -29,12 +29,17 @@ def roundtrip(im: Image.Image, **options: Any) -> ImageFile.ImageFile:
|
||||||
|
|
||||||
@pytest.mark.parametrize("test_file", test_files)
|
@pytest.mark.parametrize("test_file", test_files)
|
||||||
def test_sanity(test_file: str) -> None:
|
def test_sanity(test_file: str) -> None:
|
||||||
with Image.open(test_file) as im:
|
def check(im: ImageFile.ImageFile) -> None:
|
||||||
im.load()
|
im.load()
|
||||||
assert im.mode == "RGB"
|
assert im.mode == "RGB"
|
||||||
assert im.size == (640, 480)
|
assert im.size == (640, 480)
|
||||||
assert im.format == "MPO"
|
assert im.format == "MPO"
|
||||||
|
|
||||||
|
with Image.open(test_file) as im:
|
||||||
|
check(im)
|
||||||
|
with MpoImagePlugin.MpoImageFile(test_file) as im:
|
||||||
|
check(im)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(is_pypy(), reason="Requires CPython")
|
@pytest.mark.skipif(is_pypy(), reason="Requires CPython")
|
||||||
def test_unclosed_file() -> None:
|
def test_unclosed_file() -> None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user