Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 10 additions & 18 deletions Tests/test_arro3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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]
Expand Down
28 changes: 10 additions & 18 deletions Tests/test_nanoarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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]
Expand Down
Loading