File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import six
5
5
import itertools
6
- import pytest
6
+ import warnings
7
7
from distutils .version import LooseVersion as V
8
8
9
9
import numpy as np
10
+ import pytest
10
11
11
12
from numpy .testing import assert_equal
12
13
from numpy .testing .utils import assert_array_equal , assert_array_almost_equal
@@ -612,7 +613,10 @@ def test_colormap_reversing():
612
613
"""Check the generated _lut data of a colormap and corresponding
613
614
reversed colormap if they are almost the same."""
614
615
for name in cm .cmap_d :
615
- cmap = plt .get_cmap (name )
616
+ with warnings .catch_warnings (record = True ) as w :
617
+ warnings .simplefilter ('always' )
618
+ cmap = plt .get_cmap (name )
619
+ assert len (w ) == (1 if name in ('spectral' , 'spectral_r' ) else 0 )
616
620
cmap_r = cmap .reversed ()
617
621
if not cmap_r ._isinit :
618
622
cmap ._init ()
You can’t perform that action at this time.
0 commit comments