summaryrefslogtreecommitdiff
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
authorBatuhan Taşkaya <47358913+isidentical@users.noreply.github.com>2019-05-21 20:47:42 +0300
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-05-21 10:47:42 -0700
commitaa32a7e1116f7aaaef9fec453db910e90ab7b101 (patch)
tree2e361b8ada3bdcaac42a8aa0e237baaf814d66c9 /Lib/test/test_argparse.py
parentd5c120f7eb6f2a9cdab282a5d588afed307a23df (diff)
downloadcpython-git-aa32a7e1116f7aaaef9fec453db910e90ab7b101.tar.gz
bpo-23378: Add an extend action to argparse (GH-13305)
Add an extend action to argparse https://bugs.python.org/issue23378
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index e849c7ba49..9d68f40571 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -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
# ================