Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cfad8d9

Browse files
committed
Reinstate strictness of test_imsave_color_alpha
1 parent 3e532e1 commit cfad8d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/matplotlib/tests/test_image.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,13 @@ def test_imsave_color_alpha():
160160
buff.seek(0)
161161
arr_buf = plt.imread(buff)
162162

163-
# Recreate the float -> uint8 -> float32 conversion of the data
164-
data = (255*data).astype('uint8').astype('float')/255
163+
# Recreate the float -> uint8 conversion of the data
164+
# We can only expect to be the same with 8 bits of precision,
165+
# since that's what the PNG file used.
166+
data = (255*data).astype('uint8')
167+
arr_buf = (255*arr_buf).astype('uint8')
165168

166-
assert_allclose(data, arr_buf)
169+
assert_array_equal(data, arr_buf)
167170

168171
@image_comparison(baseline_images=['image_alpha'], remove_text=True)
169172
def test_image_alpha():

0 commit comments

Comments
 (0)