Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5cafb57

Browse files
authored
Update test_colors.py
1 parent 7e8a940 commit 5cafb57

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

lib/matplotlib/tests/test_colors.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@
2121
import matplotlib.cbook as cbook
2222
import matplotlib.pyplot as plt
2323
from matplotlib.testing.decorators import image_comparison
24-
25-
def test_copy():
26-
cm = plt.cm.Reds
27-
cm([-1, 0, .5, np.nan, np.inf])
28-
cm.set_bad('y')
29-
cm2 = copy.copy(cm)
30-
cm2.set_bad('b')
31-
cm.set_under('k')
32-
cm2.set_under('r')
33-
cm.set_over('c')
34-
cm2.set_over('m')
35-
36-
assert_equal(np.not_equal(cm._lut, cm2._lut), True)
3724

3825
def test_resample():
3926
"""
@@ -56,6 +43,18 @@ def test_resample():
5643
assert_array_almost_equal(lsc3([0, 0.5, 1]), expected)
5744
assert_array_almost_equal(lc3([0, 0.5, 1]), expected)
5845

46+
def test_colormap_copy():
47+
cm = plt.cm.Reds
48+
cm([-1, 0, .5, np.nan, np.inf])
49+
cm.set_bad('y')
50+
cm2 = copy.copy(cm)
51+
cm2.set_bad('b')
52+
cm.set_under('k')
53+
cm2.set_under('r')
54+
cm.set_over('c')
55+
cm2.set_over('m')
56+
assert_equal(np.not_equal(cm._lut, cm2._lut), True)
57+
5958

6059
def test_colormap_endian():
6160
"""

0 commit comments

Comments
 (0)