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

Skip to content

Commit a88f5dd

Browse files
committed
TST : tests to make sure rcparams get validated
- assert raise on invalid update - assert raise on invalid init
1 parent 1f06313 commit a88f5dd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/matplotlib/tests/test_rcparams.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ def test_RcParams_class():
103103
assert ['font.family'] == list(six.iterkeys(rc.find_all('family')))
104104

105105

106+
def test_rcparams_update():
107+
rc = mpl.RcParams({'figure.figsize': (3.5, 42)})
108+
bad_dict = {'figure.figsize': (3.5, 42, 1)}
109+
# make sure validation happens on input
110+
with assert_raises(ValueError):
111+
rc.update(bad_dict)
112+
113+
114+
def test_rcparams_init():
115+
with assert_raises(ValueError):
116+
mpl.RcParams({'figure.figsize': (3.5, 42, 1)})
117+
118+
106119
def test_Bug_2543():
107120
# Test that it possible to add all values to itself / deepcopy
108121
# This was not possible because validate_bool_maybe_none did not

0 commit comments

Comments
 (0)