mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-11 17:56:18 +03:00
parametrize test_file_tar::test_sanity()
This commit is contained in:
parent
50f5eade47
commit
cd4656410f
|
@ -10,18 +10,21 @@ from .helper import is_pypy
|
||||||
TEST_TAR_FILE = "Tests/images/hopper.tar"
|
TEST_TAR_FILE = "Tests/images/hopper.tar"
|
||||||
|
|
||||||
|
|
||||||
def test_sanity():
|
@pytest.mark.parametrize(
|
||||||
for codec, test_path, format in [
|
("codec", "test_path", "format"),
|
||||||
["zlib", "hopper.png", "PNG"],
|
(
|
||||||
["jpg", "hopper.jpg", "JPEG"],
|
("zlib", "hopper.png", "PNG"),
|
||||||
]:
|
("jpg", "hopper.jpg", "JPEG"),
|
||||||
if features.check(codec):
|
),
|
||||||
with TarIO.TarIO(TEST_TAR_FILE, test_path) as tar:
|
)
|
||||||
with Image.open(tar) as im:
|
def test_sanity(codec, test_path, format):
|
||||||
im.load()
|
if features.check(codec):
|
||||||
assert im.mode == "RGB"
|
with TarIO.TarIO(TEST_TAR_FILE, test_path) as tar:
|
||||||
assert im.size == (128, 128)
|
with Image.open(tar) as im:
|
||||||
assert im.format == format
|
im.load()
|
||||||
|
assert im.mode == "RGB"
|
||||||
|
assert im.size == (128, 128)
|
||||||
|
assert im.format == format
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(is_pypy(), reason="Requires CPython")
|
@pytest.mark.skipif(is_pypy(), reason="Requires CPython")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user