Skip to content
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