Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ecb75e26
Commit
ecb75e26
authored
Apr 10, 2015
by
Berker Peksag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23062: Add a test for suppressing --version with argparse.SUPPRESS.
TestHelpVersionOptional was redundant.
parent
7e7a3dba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
28 deletions
+26
-28
Lib/test/test_argparse.py
Lib/test/test_argparse.py
+26
-28
No files found.
Lib/test/test_argparse.py
View file @
ecb75e26
...
...
@@ -3845,34 +3845,6 @@ class TestHelpNoHelpOptional(HelpTestCase):
version
=
''
class
TestHelpVersionOptional
(
HelpTestCase
):
"""Test that the --version argument can be suppressed help messages"""
parser_signature
=
Sig
(
prog
=
'PROG'
)
argument_signatures
=
[
Sig
(
'-v'
,
'--version'
,
action
=
'version'
,
version
=
'1.0'
),
Sig
(
'--foo'
,
help
=
'foo help'
),
Sig
(
'spam'
,
help
=
'spam help'
),
]
argument_group_signatures
=
[]
usage
=
'''
\
usage: PROG [-h] [-v] [--foo FOO] spam
'''
help
=
usage
+
'''
\
positional arguments:
spam spam help
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
--foo FOO foo help
'''
version
=
'''
\
1.0
'''
class
TestHelpNone
(
HelpTestCase
):
"""Test that no errors occur if no help is specified"""
...
...
@@ -4080,6 +4052,32 @@ class TestHelpVersionAction(HelpTestCase):
'''
version
=
''
class
TestHelpVersionActionSuppress
(
HelpTestCase
):
"""Test that the --version argument can be suppressed in help messages"""
parser_signature
=
Sig
(
prog
=
'PROG'
)
argument_signatures
=
[
Sig
(
'-v'
,
'--version'
,
action
=
'version'
,
version
=
'1.0'
,
help
=
argparse
.
SUPPRESS
),
Sig
(
'--foo'
,
help
=
'foo help'
),
Sig
(
'spam'
,
help
=
'spam help'
),
]
argument_group_signatures
=
[]
usage
=
'''
\
usage: PROG [-h] [--foo FOO] spam
'''
help
=
usage
+
'''
\
positional arguments:
spam spam help
optional arguments:
-h, --help show this help message and exit
--foo FOO foo help
'''
class
TestHelpSubparsersOrdering
(
HelpTestCase
):
"""Test ordering of subcommands in help matches the code"""
parser_signature
=
Sig
(
prog
=
'PROG'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment