diff --git a/xarray/tests/test_plot.py b/xarray/tests/test_plot.py index bbec056785a..93246514c99 100644 --- a/xarray/tests/test_plot.py +++ b/xarray/tests/test_plot.py @@ -538,11 +538,13 @@ def test_cmap_sequential_option(self): assert cmap_params['cmap'] == 'magma' def test_do_nothing_if_provided_cmap(self): + cmap_list = [ + mpl.colors.LinearSegmentedColormap.from_list('name', ['r', 'g']), + mpl.colors.ListedColormap(['r', 'g', 'b']) + ] + # can't parametrize with mpl objects - for cmap in [ - mpl.colors.LinearSegmentedColormap.from_list( - 'name', ['r', 'g', 'b']), - mpl.colors.ListedColormap(['r', 'g', 'b'])]: + for cmap in cmap_list: cmap_params = _determine_cmap_params(self.data, cmap=cmap, levels=7)