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:
Batuhan Taşkaya 2019-05-21 20:47:42 +03:00 committed by Miss Islington (bot)
parent d5c120f7eb
commit aa32a7e111
4 changed files with 26 additions and 0 deletions

View file

@ -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
# ================