Skip to content

Commit d941a85

Browse files
Franklin, SamuelFranklin, Samuel
Franklin, Samuel
authored and
Franklin, Samuel
committed
bpo-37910: checks format_usage wrapping to ensure whitespaces do not break argparse usage help text. Fixed whitespace issue.
1 parent ad76df5 commit d941a85

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

Lib/test/test_argparse.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5482,32 +5482,6 @@ def test_help_with_metavar(self):
54825482
'''))
54835483

54845484

5485-
class TestHelpUsageWrapAllowsNilAndTab(HelpTestCase):
5486-
"""Usage message should wrap successfully when metavar='' or literal tab
5487-
Other whitespace characters may behave differently on different systems,
5488-
but should not cause an assertion error."""
5489-
5490-
parser_signature = Sig(prog='PROG' * 19)
5491-
argument_signatures = [
5492-
Sig('--nil', metavar=''),
5493-
Sig('--Tab', metavar='\ttab')
5494-
]
5495-
argument_group_signatures = []
5496-
usage = '''\
5497-
usage: PROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROGPROG
5498-
[-h] [--nil] [--Tab tab]
5499-
'''
5500-
help = usage + '''\
5501-
5502-
optional arguments:
5503-
-h, --help show this help message and exit
5504-
--nil \
5505-
5506-
--Tab tab
5507-
'''
5508-
version = ''
5509-
5510-
55115485
class TestExitOnError(TestCase):
55125486

55135487
def setUp(self):

0 commit comments

Comments
 (0)