Merge pull request #5996 from radarhere/parametrize

Parametrize test
This commit is contained in:
Hugo van Kemenade 2022-01-29 09:12:26 +02:00 committed by GitHub
commit c3845a934b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,8 +189,9 @@ def test_putdata():
assert len(im.getdata()) == len(arr) assert len(im.getdata()) == len(arr)
def test_roundtrip_eye(): @pytest.mark.parametrize(
for dtype in ( "dtype",
(
bool, bool,
numpy.bool8, numpy.bool8,
numpy.int8, numpy.int8,
@ -202,9 +203,11 @@ def test_roundtrip_eye():
float, float,
numpy.float32, numpy.float32,
numpy.float64, numpy.float64,
): ),
arr = numpy.eye(10, dtype=dtype) )
numpy.testing.assert_array_equal(arr, numpy.array(Image.fromarray(arr))) def test_roundtrip_eye(dtype):
arr = numpy.eye(10, dtype=dtype)
numpy.testing.assert_array_equal(arr, numpy.array(Image.fromarray(arr)))
def test_zero_size(): def test_zero_size():