Skip to content

Commit 97a4d1f

Browse files
authored
Replace print with assert (#9171)
2 parents 9f5d1f7 + 84122a2 commit 97a4d1f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Tests/test_numpy.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@ def to_image(dtype: npt.DTypeLike, bands: int = 1, boolean: int = 0) -> Image.Im
2828
a = numpy.array(data, dtype=dtype)
2929
a.shape = TEST_IMAGE_SIZE
3030
i = Image.fromarray(a)
31-
if list(i.getdata()) != data:
32-
print("data mismatch for", dtype)
31+
assert list(i.getdata()) == data
3332
else:
3433
data = list(range(100))
3534
a = numpy.array([[x] * bands for x in data], dtype=dtype)
3635
a.shape = TEST_IMAGE_SIZE[0], TEST_IMAGE_SIZE[1], bands
3736
i = Image.fromarray(a)
38-
if list(i.getchannel(0).getdata()) != list(range(100)):
39-
print("data mismatch for", dtype)
37+
assert list(i.getchannel(0).getdata()) == list(range(100))
4038
return i
4139

4240
# Check supported 1-bit integer formats

0 commit comments

Comments
 (0)