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
extend 'add test for the new function 'validate_grid_linestyle'
  • Loading branch information
afvincent committed Feb 7, 2017
commit 5be29b5015c110bc8bbe57ad152d7d85c64198a1
18 changes: 17 additions & 1 deletion lib/matplotlib/tests/test_rcparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
validate_nseq_float,
validate_cycler,
validate_hatch,
validate_hist_bins)
validate_hist_bins,
validate_grid_linestyle)


mpl.rc('text', usetex=False)
Expand Down Expand Up @@ -333,6 +334,21 @@ def generate_validator_testcases(valid):
),
'fail': (('aardvark', ValueError),
)
},
{'validator': validate_grid_linestyle,
'success': (('--', '--'),
('dotted', 'dotted'),
('aardvark', 'aardvark'),
(['1.23', '4.56'], (None, [1.23, 4.56])),
([1.23, 456], (None, [1.23, 456.0])),
([1, 2, 3, 4], (None, [1.0, 2.0, 3.0, 4.0])),
),
'fail': (((None, [1, 2]), ValueError),
((0, [1, 2]), ValueError),
((-1, [1, 2]), ValueError),
([1, 2, 3], ValueError),
(1.23, ValueError)
)
}
)

Expand Down