Skip to content

Commit 2bd330d

Browse files
committed
Add Vega* colormaps to warning check in test.
1 parent d700f03 commit 2bd330d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/tests/test_colors.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,13 @@ def test_pandas_iterable():
612612
def test_colormap_reversing(name):
613613
"""Check the generated _lut data of a colormap and corresponding
614614
reversed colormap if they are almost the same."""
615+
should_have_warning = {'spectral', 'spectral_r', 'Vega10', 'Vega10_r',
616+
'Vega20', 'Vega20_r', 'Vega20b', 'Vega20b_r',
617+
'Vega20c', 'Vega20c_r'}
615618
with warnings.catch_warnings(record=True) as w:
616619
warnings.simplefilter('always')
617620
cmap = plt.get_cmap(name)
618-
assert len(w) == (1 if name in ('spectral', 'spectral_r') else 0)
621+
assert len(w) == (1 if name in should_have_warning else 0)
619622
cmap_r = cmap.reversed()
620623
if not cmap_r._isinit:
621624
cmap._init()

0 commit comments

Comments
 (0)