mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-10 06:12:27 +03:00
Replaced print with assert
This commit is contained in:
parent
9f5d1f71a0
commit
84122a20c7
|
@ -28,15 +28,13 @@ def test_numpy_to_image() -> None:
|
||||||
a = numpy.array(data, dtype=dtype)
|
a = numpy.array(data, dtype=dtype)
|
||||||
a.shape = TEST_IMAGE_SIZE
|
a.shape = TEST_IMAGE_SIZE
|
||||||
i = Image.fromarray(a)
|
i = Image.fromarray(a)
|
||||||
if list(i.getdata()) != data:
|
assert list(i.getdata()) == data
|
||||||
print("data mismatch for", dtype)
|
|
||||||
else:
|
else:
|
||||||
data = list(range(100))
|
data = list(range(100))
|
||||||
a = numpy.array([[x] * bands for x in data], dtype=dtype)
|
a = numpy.array([[x] * bands for x in data], dtype=dtype)
|
||||||
a.shape = TEST_IMAGE_SIZE[0], TEST_IMAGE_SIZE[1], bands
|
a.shape = TEST_IMAGE_SIZE[0], TEST_IMAGE_SIZE[1], bands
|
||||||
i = Image.fromarray(a)
|
i = Image.fromarray(a)
|
||||||
if list(i.getchannel(0).getdata()) != list(range(100)):
|
assert list(i.getchannel(0).getdata()) == list(range(100))
|
||||||
print("data mismatch for", dtype)
|
|
||||||
return i
|
return i
|
||||||
|
|
||||||
# Check supported 1-bit integer formats
|
# Check supported 1-bit integer formats
|
||||||
|
|
Loading…
Reference in New Issue
Block a user