Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrize test_file_tar::test_sanity() #6898

Merged
merged 2 commits into from
Jan 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions Tests/test_file_tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@
TEST_TAR_FILE = "Tests/images/hopper.tar"


def test_sanity():
for codec, test_path, format in [
["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:
im.load()
assert im.mode == "RGB"
assert im.size == (128, 128)
assert im.format == format
@pytest.mark.parametrize(
("codec", "test_path", "format"),
Yay295 marked this conversation as resolved.
Show resolved Hide resolved
(
("zlib", "hopper.png", "PNG"),
("jpg", "hopper.jpg", "JPEG"),
),
)
def test_sanity(codec, test_path, format):
if features.check(codec):
with TarIO.TarIO(TEST_TAR_FILE, test_path) as tar:
with Image.open(tar) as im:
im.load()
assert im.mode == "RGB"
assert im.size == (128, 128)
assert im.format == format


@pytest.mark.skipif(is_pypy(), reason="Requires CPython")
Expand Down