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

Skip to content

Commit 5be29b5

Browse files
committed
extend 'add test for the new function 'validate_grid_linestyle'
1 parent 061061b commit 5be29b5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

lib/matplotlib/tests/test_rcparams.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
validate_nseq_float,
3030
validate_cycler,
3131
validate_hatch,
32-
validate_hist_bins)
32+
validate_hist_bins,
33+
validate_grid_linestyle)
3334

3435

3536
mpl.rc('text', usetex=False)
@@ -333,6 +334,21 @@ def generate_validator_testcases(valid):
333334
),
334335
'fail': (('aardvark', ValueError),
335336
)
337+
},
338+
{'validator': validate_grid_linestyle,
339+
'success': (('--', '--'),
340+
('dotted', 'dotted'),
341+
('aardvark', 'aardvark'),
342+
(['1.23', '4.56'], (None, [1.23, 4.56])),
343+
([1.23, 456], (None, [1.23, 456.0])),
344+
([1, 2, 3, 4], (None, [1.0, 2.0, 3.0, 4.0])),
345+
),
346+
'fail': (((None, [1, 2]), ValueError),
347+
((0, [1, 2]), ValueError),
348+
((-1, [1, 2]), ValueError),
349+
([1, 2, 3], ValueError),
350+
(1.23, ValueError)
351+
)
336352
}
337353
)
338354

0 commit comments

Comments
 (0)