[Python-checkins] cpython (merge 3.2 -> default): Merge with 3.2

terry.reedy python-checkins at python.org
Tue Jan 10 00:34:30 CET 2012


http://hg.python.org/cpython/rev/4f8c24830a5c
changeset:   74317:4f8c24830a5c
parent:      74315:bf609baff4d3
parent:      74316:b950267efd59
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Mon Jan 09 18:33:27 2012 -0500
summary:
  Merge with 3.2

files:
  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
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -2170,8 +2170,9 @@
         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 @@
 
             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 @@
             ['-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 @@
 
               -w W
               -x X
-        '''.format(self.main_program)))
+        '''.format(progname, ' ' if progname else '' )))
 
 # ==============================
 # Mutually exclusive group tests

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list