Skip to content

Add vega deprecations to tests on master #7987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Parametrize colormap reversing test.
This is a bit nicer for debugging.
  • Loading branch information
QuLogic committed Jan 30, 2017
commit d700f039a6f10ffb795c59467fa62bfde8aa162d
22 changes: 11 additions & 11 deletions lib/matplotlib/tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,19 +608,19 @@ def test_pandas_iterable():
assert_array_equal(cm1.colors, cm2.colors)


def test_colormap_reversing():
@pytest.mark.parametrize('name', cm.cmap_d)
def test_colormap_reversing(name):
"""Check the generated _lut data of a colormap and corresponding
reversed colormap if they are almost the same."""
for name in cm.cmap_d:
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
cmap = plt.get_cmap(name)
assert len(w) == (1 if name in ('spectral', 'spectral_r') else 0)
cmap_r = cmap.reversed()
if not cmap_r._isinit:
cmap._init()
cmap_r._init()
assert_array_almost_equal(cmap._lut[:-3], cmap_r._lut[-4::-1])
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
cmap = plt.get_cmap(name)
assert len(w) == (1 if name in ('spectral', 'spectral_r') else 0)
cmap_r = cmap.reversed()
if not cmap_r._isinit:
cmap._init()
cmap_r._init()
assert_array_almost_equal(cmap._lut[:-3], cmap_r._lut[-4::-1])


@cleanup
Expand Down