We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e532e1 commit cfad8d9Copy full SHA for cfad8d9
lib/matplotlib/tests/test_image.py
@@ -160,10 +160,13 @@ def test_imsave_color_alpha():
160
buff.seek(0)
161
arr_buf = plt.imread(buff)
162
163
- # Recreate the float -> uint8 -> float32 conversion of the data
164
- data = (255*data).astype('uint8').astype('float')/255
+ # Recreate the float -> uint8 conversion of the data
+ # 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')
168
- assert_allclose(data, arr_buf)
169
+ assert_array_equal(data, arr_buf)
170
171
@image_comparison(baseline_images=['image_alpha'], remove_text=True)
172
def test_image_alpha():
0 commit comments