Skip to content
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
Prev Previous commit
Next Next commit
Add tests for _repr_png_ and _repr_html_.
  • Loading branch information
bdice committed Jul 11, 2020
commit d3ca7e251846fa1f10ecd6b2ff8619fd6eee7a25
13 changes: 13 additions & 0 deletions lib/matplotlib/tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,3 +1135,16 @@ def test_hex_shorthand_notation():
def test_DivergingNorm_deprecated():
with pytest.warns(cbook.MatplotlibDeprecationWarning):
norm = mcolors.DivergingNorm(vcenter=0)


def test_repr_png():
cmap = plt.get_cmap('viridis')
png = cmap._repr_png_()
assert len(png) > 0
Comment thread
bdice marked this conversation as resolved.


def test_repr_html():
cmap = plt.get_cmap('viridis')
html = cmap._repr_html_()
assert len(html) > 0
assert cmap.name in html