summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2017-01-22 06:39:20 (GMT)
committerXiang Zhang <angwerzx@126.com>2017-01-22 06:39:20 (GMT)
commitb1681189af1157d9b6161c8a3a645c2eb816b415 (patch)
tree398df9055b82078c557fa2e2266c35f66270aefc /Lib/test/test_argparse.py
parent4459e009ed36331a976d605270bc0a81d091aa75 (diff)
parent7fe28ad8375677a6d696271d48783d6c38a74dce (diff)
downloadcpython-b1681189af1157d9b6161c8a3a645c2eb816b415.zip
cpython-b1681189af1157d9b6161c8a3a645c2eb816b415.tar.gz
cpython-b1681189af1157d9b6161c8a3a645c2eb816b415.tar.bz2
Issue #29290: Merge 3.5.
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index bc83161..a5c4a8e 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -1943,6 +1943,23 @@ class TestAddSubparsers(TestCase):
++foo foo help
'''))
+ def test_help_non_breaking_spaces(self):
+ parser = ErrorRaisingArgumentParser(
+ prog='PROG', description='main description')
+ parser.add_argument(
+ "--non-breaking", action='store_false',
+ help='help message containing non-breaking spaces shall not '
+ 'wrap\N{NO-BREAK SPACE}at non-breaking spaces')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [--non-breaking]
+
+ main description
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --non-breaking help message containing non-breaking spaces shall not
+ wrap\N{NO-BREAK SPACE}at non-breaking spaces
+ '''))
def test_help_alternate_prefix_chars(self):
parser = self._get_parser(prefix_chars='+:/')