|
1 | 1 | from __future__ import (absolute_import, division, print_function,
|
2 | 2 | unicode_literals)
|
3 | 3 |
|
| 4 | +import warnings |
4 | 5 | import six
|
5 | 6 | from six.moves import xrange
|
6 | 7 |
|
@@ -105,10 +106,14 @@ def test_exceptions():
|
105 | 106 | # TODO should this test more options?
|
106 | 107 | assert_raises(ValueError, plt.subplots, 2, 2, sharex='blah')
|
107 | 108 | 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) |
112 | 117 |
|
113 | 118 |
|
114 | 119 | @image_comparison(baseline_images=['subplots_offset_text'], remove_text=False)
|
|
0 commit comments