8000 Rcparam validation fix by tacaswell · Pull Request #3564 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Rcparam validation fix #3564

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 19 commits into from
Oct 14, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST : tests to make sure rcparams get validated
 - assert raise on invalid update
 - assert raise on invalid init
  • Loading branch information
tacaswell committed Oct 1, 2014
commit a88f5dd77d8fb5e716f363085d623e81d0c93e6d
13 changes: 13 additions & 0 deletions lib/matplotlib/tests/test_rcparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ def test_RcParams_class():
assert ['font.family'] == list(six.iterkeys(rc.find_all('family')))


def test_rcparams_update():
rc = mpl.RcParams({'figure.figsize': (3.5, 42)})
bad_dict = {'figure.figsize': (3.5, 42, 1)}
# make sure validation happens on input
with assert_raises(ValueError):
rc.update(bad_dict)


def test_rcparams_init():
with assert_raises(ValueError):
mpl.RcParams({'figure.figsize': (3.5, 42, 1)})


def test_Bug_2543():
# Test that it possible to add all values to itself / deepcopy
# This was not possible because validate_bool_maybe_none did not
Expand Down
0