Skip to content

Commit 3ad337f

Browse files
committed
More fixes.
1 parent 6fcf4fe commit 3ad337f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

xarray/tests/test_plot.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,16 @@ def test_cmap_sequential_option(self):
539539

540540
@pytest.mark.parametrize(
541541
'cmap', [mpl.colors.LinearSegmentedColormap.from_list('name', ['r', 'g', 'b']),
542-
mpl.colors.ListedColormap(['r', 'g', 'b']),
543-
'RdBu_r'])
542+
mpl.colors.ListedColormap(['r', 'g', 'b'])])
544543
def test_do_nothing_if_provided_cmap(self, cmap):
545-
cmap_params = _determine_cmap_params(self.data, cmap=cmap)
544+
cmap_params = _determine_cmap_params(self.data, cmap=cmap, levels=7)
546545
assert cmap_params['cmap'] is cmap
547546

547+
def test_do_something_if_provided_str_cmap(self):
548+
cmap = 'RdBu_r'
549+
cmap_params = _determine_cmap_params(self.data, cmap=cmap, levels=7)
550+
assert cmap_params['cmap'] is not cmap
551+
548552
def test_cmap_sequential_explicit_option(self):
549553
with xr.set_options(cmap_sequential=mpl.cm.magma):
550554
cmap_params = _determine_cmap_params(self.data)

0 commit comments

Comments
 (0)