@@ -68,7 +68,7 @@ def test_register_cmap():
68
68
new_cm = mpl .colormaps ["viridis" ]
69
69
target = "viridis2"
70
70
with pytest .warns (
71
- PendingDeprecationWarning ,
71
+ mpl . MatplotlibDeprecationWarning ,
72
72
match = r"matplotlib\.colormaps\.register\(name\)"
73
73
):
74
74
cm .register_cmap (target , new_cm )
@@ -77,33 +77,33 @@ def test_register_cmap():
77
77
with pytest .raises (ValueError ,
78
78
match = "Arguments must include a name or a Colormap" ):
79
79
with pytest .warns (
80
- PendingDeprecationWarning ,
80
+ mpl . MatplotlibDeprecationWarning ,
81
81
match = r"matplotlib\.colormaps\.register\(name\)"
82
82
):
83
83
cm .register_cmap ()
84
84
85
85
with pytest .warns (
86
- PendingDeprecationWarning ,
86
+ mpl . MatplotlibDeprecationWarning ,
87
87
match = r"matplotlib\.colormaps\.unregister\(name\)"
88
88
):
89
89
cm .unregister_cmap (target )
90
90
with pytest .raises (ValueError ,
91
91
match = f'{ target !r} is not a valid value for name;' ):
92
92
with pytest .warns (
93
- PendingDeprecationWarning ,
93
+ mpl . MatplotlibDeprecationWarning ,
94
94
match = r"matplotlib\.colormaps\[name\]"
95
95
):
96
96
cm .get_cmap (target )
97
97
with pytest .warns (
98
- PendingDeprecationWarning ,
98
+ mpl . MatplotlibDeprecationWarning ,
99
99
match = r"matplotlib\.colormaps\.unregister\(name\)"
100
100
):
101
101
# test that second time is error free
102
102
cm .unregister_cmap (target )
103
103
104
104
with pytest .raises (TypeError , match = "'cmap' must be" ):
105
105
with pytest .warns (
106
- PendingDeprecationWarning ,
106
+ mpl . MatplotlibDeprecationWarning ,
107
107
match = r"matplotlib\.colormaps\.register\(name\)"
108
108
):
109
109
cm .register_cmap ('nome' , cmap = 'not a cmap' )
@@ -137,7 +137,7 @@ def test_double_register_builtin_cmap():
137
137
mpl .colormaps [name ], name = name , force = True
138
138
)
139
139
with pytest .raises (ValueError , match = 'A colormap named "viridis"' ):
140
- with pytest .warns (PendingDeprecationWarning ):
140
+ with pytest .warns (mpl . MatplotlibDeprecationWarning ):
141
141
cm .register_cmap (name , mpl .colormaps [name ])
142
142
with pytest .warns (UserWarning ):
143
143
# TODO is warning more than once!
@@ -148,7 +148,7 @@ def test_unregister_builtin_cmap():
148
148
name = "viridis"
149
149
match = f'cannot unregister { name !r} which is a builtin colormap.'
150
150
with pytest .raises (ValueError , match = match ):
151
- with pytest .warns (PendingDeprecationWarning ):
151
+ with pytest .warns (mpl . MatplotlibDeprecationWarning ):
152
152
cm .unregister_cmap (name )
153
153
154
154
0 commit comments