From 750bbc72569cd36ca4219a369e84c761d6e9eec8 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 31 Mar 2020 17:25:26 +1100 Subject: [PATCH] Parametrized test --- Tests/test_image.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Tests/test_image.py b/Tests/test_image.py index 9fb18b195..b0fd7c540 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -609,30 +609,33 @@ class TestImage: assert not fp.closed - def test_pillow_version(self): + @pytest.mark.parametrize( + "test_module", [PIL, Image], + ) + def test_pillow_version(self, test_module): with pytest.warns(DeprecationWarning): - assert PIL.PILLOW_VERSION == PIL.__version__ + assert test_module.PILLOW_VERSION == PIL.__version__ with pytest.warns(DeprecationWarning): - str(PIL.PILLOW_VERSION) + str(test_module.PILLOW_VERSION) with pytest.warns(DeprecationWarning): - assert int(PIL.PILLOW_VERSION[0]) >= 7 + assert int(test_module.PILLOW_VERSION[0]) >= 7 with pytest.warns(DeprecationWarning): - assert PIL.PILLOW_VERSION < "9.9.0" + assert test_module.PILLOW_VERSION < "9.9.0" with pytest.warns(DeprecationWarning): - assert PIL.PILLOW_VERSION <= "9.9.0" + assert test_module.PILLOW_VERSION <= "9.9.0" with pytest.warns(DeprecationWarning): - assert PIL.PILLOW_VERSION != "7.0.0" + assert test_module.PILLOW_VERSION != "7.0.0" with pytest.warns(DeprecationWarning): - assert PIL.PILLOW_VERSION >= "7.0.0" + assert test_module.PILLOW_VERSION >= "7.0.0" with pytest.warns(DeprecationWarning): - assert PIL.PILLOW_VERSION > "7.0.0" + assert test_module.PILLOW_VERSION > "7.0.0" def test_overrun(self): for file in [