Merge pull request #6898 from Yay295/parametrize_tar_test

Parametrize test_file_tar::test_sanity()
This commit is contained in:
mergify[bot] 2023-01-16 02:29:56 +00:00 committed by GitHub
commit 77b316c8f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,11 +10,14 @@ 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"),
),
)
def test_sanity(codec, test_path, format):
if features.check(codec): if features.check(codec):
with TarIO.TarIO(TEST_TAR_FILE, test_path) as tar: with TarIO.TarIO(TEST_TAR_FILE, test_path) as tar:
with Image.open(tar) as im: with Image.open(tar) as im: