8000
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 068fa28 commit e05a632Copy full SHA for e05a632
lib/matplotlib/tests/test_image.py
@@ -801,16 +801,18 @@ def test_imshow_clips_rgb_to_valid_range(dtype):
801
arr = np.arange(300, dtype=dtype).reshape((10, 10, 3))
802
if dtype.kind != 'u':
803
arr -= 10
804
+ too_low = arr < 0
805
+ too_high = arr > 255
806
if dtype.kind == 'f':
807
arr = arr / 255
808
_, ax = plt.subplots()
809
out = ax.imshow(arr).get_array()
- assert out.min() == 0
810
+ assert (out[too_low] == 0).all()
811
- assert out.max() == 1
812
+ assert (out[too_high] == 1).all()
813
assert out.dtype.kind == 'f'
814
else:
- assert out.max() == 255
815
+ assert (out[too_high] == 255).all()
816
assert out.dtype == np.uint8
817
818
0 commit comments