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

Skip to content

Filter warnings in rcparams test (and others) #3244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 26, 2014
Merged
Prev Previous commit
Next Next commit
Suppress some more warnings.
These are genuine too so we filter them
  • Loading branch information
jenshnielsen committed Jul 22, 2014
commit c56ece1dc7c432004b4fd6c7090dd3949b33ecd2
13 changes: 9 additions & 4 deletions lib/matplotlib/tests/test_subplots.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import warnings
import six
from six.moves import xrange

Expand Down Expand Up @@ -105,10 +106,14 @@ def test_exceptions():
# TODO should this test more options?
assert_raises(ValueError, plt.subplots, 2, 2, sharex='blah')
assert_raises(ValueError, plt.subplots, 2, 2, sharey='blah')
assert_raises(ValueError, plt.subplots, 2, 2, -1)
# uncomment this for 1.5
# assert_raises(ValueError, plt.subplots, 2, 2, 0)
assert_raises(ValueError, plt.subplots, 2, 2, 5)
with warnings.catch_warnings():
warnings.filterwarnings('ignore',
message='.*sharex\ argument\ to\ subplots',
category=UserWarning)
assert_raises(ValueError, plt.subplots, 2, 2, -1)
# uncomment this for 1.5
# assert_raises(ValueError, plt.subplots, 2, 2, 0)
assert_raises(ValueError, plt.subplots, 2, 2, 5)


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