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

Skip to content

Commit c56ece1

Browse files
committed
Suppress some more warnings.
These are genuine too so we filter them
1 parent cd75c01 commit c56ece1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/matplotlib/tests/test_subplots.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import (absolute_import, division, print_function,
22
unicode_literals)
33

4+
import warnings
45
import six
56
from six.moves import xrange
67

@@ -105,10 +106,14 @@ def test_exceptions():
105106
# TODO should this test more options?
106107
assert_raises(ValueError, plt.subplots, 2, 2, sharex='blah')
107108
assert_raises(ValueError, plt.subplots, 2, 2, sharey='blah')
108-
assert_raises(ValueError, plt.subplots, 2, 2, -1)
109-
# uncomment this for 1.5
110-
# assert_raises(ValueError, plt.subplots, 2, 2, 0)
111-
assert_raises(ValueError, plt.subplots, 2, 2, 5)
109+
with warnings.catch_warnings():
110+
warnings.filterwarnings('ignore',
111+
message='.*sharex\ argument\ to\ subplots',
112+
category=UserWarning)
113+
assert_raises(ValueError, plt.subplots, 2, 2, -1)
114+
# uncomment this for 1.5
115+
# assert_raises(ValueError, plt.subplots, 2, 2, 0)
116+
assert_raises(ValueError, plt.subplots, 2, 2, 5)
112117

113118

114119
@image_comparison(baseline_images=['subplots_offset_text'], remove_text=False)

0 commit comments

Comments
 (0)