mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
bpo-23378: Add an extend action to argparse (GH-13305)
Add an extend action to argparse https://bugs.python.org/issue23378
This commit is contained in:
parent
d5c120f7eb
commit
aa32a7e111
4 changed files with 26 additions and 0 deletions
|
@ -1786,6 +1786,15 @@ class TestActionRegistration(TestCase):
|
|||
self.assertEqual(parser.parse_args(['42']), NS(badger='foo[42]'))
|
||||
|
||||
|
||||
class TestActionExtend(ParserTestCase):
|
||||
argument_signatures = [
|
||||
Sig('--foo', action="extend", nargs="+", type=str),
|
||||
]
|
||||
failures = ()
|
||||
successes = [
|
||||
('--foo f1 --foo f2 f3 f4', NS(foo=['f1', 'f2', 'f3', 'f4'])),
|
||||
]
|
||||
|
||||
# ================
|
||||
# Subparsers tests
|
||||
# ================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue