Skip to content

ENH: Stricter validation of line style rcParams (and extended accepted types for grid.linestyle) #8040

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 15 commits into from
Feb 18, 2017
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