diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2012-01-09 18:33:27 -0500 |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2012-01-09 18:33:27 -0500 |
commit | 8d172343ad4d6b79ed076b294dfe963ebdab7c84 (patch) | |
tree | 38087e46a83b10cf1dcfb6ebfe627ee87e9e0701 /Lib/test/test_argparse.py | |
parent | dc3044c7043b687f3be97a731d873dc991f5d83b (diff) | |
parent | ee91e0990a80e44d559cb602560ee05d266617cd (diff) | |
download | cpython-git-8d172343ad4d6b79ed076b294dfe963ebdab7c84.tar.gz |
Merge with 3.2
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r-- | Lib/test/test_argparse.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index 5a409192d9..f4567096d8 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -2170,8 +2170,9 @@ class TestParentParsers(TestCase): parents = [self.abcd_parent, self.wxyz_parent] parser = ErrorRaisingArgumentParser(parents=parents) parser_help = parser.format_help() + progname = self.main_program self.assertEqual(parser_help, textwrap.dedent('''\ - usage: {} [-h] [-b B] [--d D] [--w W] [-y Y] a z + usage: {}{}[-h] [-b B] [--d D] [--w W] [-y Y] a z positional arguments: a @@ -2187,7 +2188,7 @@ class TestParentParsers(TestCase): x: -y Y - '''.format(self.main_program))) + '''.format(progname, ' ' if progname else '' ))) def test_groups_parents(self): parent = ErrorRaisingArgumentParser(add_help=False) @@ -2203,8 +2204,9 @@ class TestParentParsers(TestCase): ['-y', 'Y', '-z', 'Z']) parser_help = parser.format_help() + progname = self.main_program self.assertEqual(parser_help, textwrap.dedent('''\ - usage: {} [-h] [-w W] [-x X] [-y Y | -z Z] + usage: {}{}[-h] [-w W] [-x X] [-y Y | -z Z] optional arguments: -h, --help show this help message and exit @@ -2216,7 +2218,7 @@ class TestParentParsers(TestCase): -w W -x X - '''.format(self.main_program))) + '''.format(progname, ' ' if progname else '' ))) # ============================== # Mutually exclusive group tests |