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

Skip to content

Commit 4c8205f

Browse files
committed
TST: ContourSet vmin/vmax deprecation warnings
1 parent 359de9f commit 4c8205f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/matplotlib/tests/test_contour.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,25 @@ def test_contourf_decreasing_levels():
279279
assert_equal(len(w), 2)
280280

281281

282+
@cleanup
283+
def test_vminvmax_warning():
284+
z = [[0.1, 0.3], [0.5, 0.7]]
285+
plt.figure()
286+
cs = plt.contourf(z, [0.0, 1.0])
287+
288+
with warnings.catch_warnings(record=True) as w:
289+
cs.vmin
290+
assert len(w) == 1
291+
assert (str(w[0].message).startswith(
292+
("vmin is deprecated and will be removed in 2.2 ")))
293+
294+
with warnings.catch_warnings(record=True) as w:
295+
cs.vmax
296+
assert len(w) == 1
297+
assert (str(w[0].message).startswith(
298+
("vmax is deprecated and will be removed in 2.2 ")))
299+
300+
282301
if __name__ == '__main__':
283302
import nose
284303
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)