Skip to content

Commit e071225

Browse files
committed
add test cases
1 parent 3793526 commit e071225

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Lib/test/test_argparse.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,25 @@ class TestOptionalsNargsDefault(ParserTestCase):
607607
('-x a', NS(x='a')),
608608
]
609609

610+
class TestNargsDefaultConvert(ParserTestCase):
611+
"""Tests not specifying the number of args for an Optional"""
612+
613+
argument_signatures = [Sig('-x', type=int, nargs='+', default=['1', '2'])]
614+
failures = []
615+
successes = [
616+
('', NS(x=[1, 2])),
617+
]
618+
619+
620+
class TestListDefaultConvert(ParserTestCase):
621+
"""Tests not specifying the number of args for an Optional"""
622+
623+
argument_signatures = [Sig('-x', type=int, default=['1', '2'])]
624+
failures = []
625+
successes = [
626+
('', NS(x=['1', '2'])),
627+
]
628+
610629

611630
class TestOptionalsNargs1(ParserTestCase):
612631
"""Tests specifying 1 arg for an Optional"""

0 commit comments

Comments
 (0)