diff --git a/Tests/test_arro3.py b/Tests/test_arro3.py index a7c755fc2b6..b0d066de769 100644 --- a/Tests/test_arro3.py +++ b/Tests/test_arro3.py @@ -112,8 +112,6 @@ def test_to_array(mode: str, dtype: DataType, mask: list[int] | None) -> None: reloaded = Image.fromarrow(arr, mode, img.size) - assert reloaded - assert_image_equal(img, reloaded) @@ -150,8 +148,7 @@ def test_lifetime2() -> None: assert compute.sum(arr_2).as_py() > 0 del arr_2 - img2 = img.copy() - px = img2.load() + px = img.load() assert px # make mypy happy assert isinstance(px[0, 0], int) @@ -225,23 +222,18 @@ def test_fromarray(mode: str, data_tp: DataShape, mask: list[int] | None) -> Non @pytest.mark.parametrize( - "mode, data_tp, mask", + "mode, mask", ( - ("LA", UINT32, [0, 3]), - ("RGB", UINT32, [0, 1, 2]), - ("RGBA", UINT32, None), - ("CMYK", UINT32, None), - ("YCbCr", UINT32, [0, 1, 2]), - ("HSV", UINT32, [0, 1, 2]), - ("LA", INT32, [0, 3]), - ("RGB", INT32, [0, 1, 2]), - ("RGBA", INT32, None), - ("CMYK", INT32, None), - ("YCbCr", INT32, [0, 1, 2]), - ("HSV", INT32, [0, 1, 2]), + ("LA", [0, 3]), + ("RGB", [0, 1, 2]), + ("RGBA", None), + ("CMYK", None), + ("YCbCr", [0, 1, 2]), + ("HSV", [0, 1, 2]), ), ) -def test_from_int32array(mode: str, data_tp: DataShape, mask: list[int] | None) -> None: +@pytest.mark.parametrize("data_tp", (UINT32, INT32)) +def test_from_int32array(mode: str, mask: list[int] | None, data_tp: DataShape) -> None: (dtype, elt, elts_per_pixel) = data_tp ct_pixels = TEST_IMAGE_SIZE[0] * TEST_IMAGE_SIZE[1] diff --git a/Tests/test_nanoarrow.py b/Tests/test_nanoarrow.py index b08333ae97b..a5a8ab00d2c 100644 --- a/Tests/test_nanoarrow.py +++ b/Tests/test_nanoarrow.py @@ -112,8 +112,6 @@ def test_to_array(mode: str, dtype: nanoarrow, mask: list[int] | None) -> None: reloaded = Image.fromarrow(arr, mode, img.size) - assert reloaded - assert_image_equal(img, reloaded) @@ -150,8 +148,7 @@ def test_lifetime2() -> None: assert sum(arr_2.iter_py()) > 0 del arr_2 - img2 = img.copy() - px = img2.load() + px = img.load() assert px # make mypy happy assert isinstance(px[0, 0], int) @@ -232,23 +229,18 @@ def test_fromarray(mode: str, data_tp: DataShape, mask: list[int] | None) -> Non @pytest.mark.parametrize( - "mode, data_tp, mask", + "mode, mask", ( - ("LA", UINT32, [0, 3]), - ("RGB", UINT32, [0, 1, 2]), - ("RGBA", UINT32, None), - ("CMYK", UINT32, None), - ("YCbCr", UINT32, [0, 1, 2]), - ("HSV", UINT32, [0, 1, 2]), - ("LA", INT32, [0, 3]), - ("RGB", INT32, [0, 1, 2]), - ("RGBA", INT32, None), - ("CMYK", INT32, None), - ("YCbCr", INT32, [0, 1, 2]), - ("HSV", INT32, [0, 1, 2]), + ("LA", [0, 3]), + ("RGB", [0, 1, 2]), + ("RGBA", None), + ("CMYK", None), + ("YCbCr", [0, 1, 2]), + ("HSV", [0, 1, 2]), ), ) -def test_from_int32array(mode: str, data_tp: DataShape, mask: list[int] | None) -> None: +@pytest.mark.parametrize("data_tp", (UINT32, INT32)) +def test_from_int32array(mode: str, mask: list[int] | None, data_tp: DataShape) -> None: (dtype, elt, elts_per_pixel) = data_tp ct_pixels = TEST_IMAGE_SIZE[0] * TEST_IMAGE_SIZE[1]