8000 TST: test re-registering builtin colormap · matplotlib/matplotlib@98117b0 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 98117b0

Browse files
committed
TST: test re-registering builtin colormap
The existing test bounced on an earlier code path. This restores missing coverage.
1 parent 
F585
1b8866e commit 98117b0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/tests/test_colors.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ def test_register_cmap():
8686

8787
def test_double_register_builtin_cmap():
8888
name = "viridis"
89+
match = f"Re-registering the builtin cmap {name!r}."
90+
with pytest.raises(ValueError, match=match):
91+
matplotlib.colormaps.register(
92+
cm.get_cmap(name), name=name, force=True
93+
)
8994
with pytest.raises(ValueError, match='A colormap named "viridis"'):
9095
cm.register_cmap(name, cm.get_cmap(name))
9196
with pytest.warns(UserWarning):

0 commit comments

Comments
 (0)
0