MCPcopy Index your code
hub / github.com/RustPython/RustPython / _create_parser

Function _create_parser

Lib/test/libregrtest/cmdline.py:214–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

212
213
214def _create_parser():
215 # Set prog to prevent the uninformative "__main__.py" from displaying in
216 # error messages when using "python -m test ...".
217 parser = _ArgParser(prog='regrtest.py',
218 usage=USAGE,
219 description=DESCRIPTION,
220 epilog=EPILOG,
221 add_help=False,
222 formatter_class=argparse.RawDescriptionHelpFormatter)
223 parser.set_defaults(match_tests=[])
224
225 # Arguments with this clause added to its help are described further in
226 # the epilog's "Additional option details" section.
227 more_details = ' See the section at bottom for more details.'
228
229 group = parser.add_argument_group('General options')
230 # We add help explicitly to control what argument group it renders under.
231 group.add_argument('-h', '--help', action='help',
232 help='show this help message and exit')
233 group.add_argument('--fast-ci', action='store_true',
234 help='Fast Continuous Integration (CI) mode used by '
235 'GitHub Actions')
236 group.add_argument('--slow-ci', action='store_true',
237 help='Slow Continuous Integration (CI) mode used by '
238 'buildbot workers')
239 group.add_argument('--timeout', metavar='TIMEOUT',
240 help='dump the traceback and exit if a test takes '
241 'more than TIMEOUT seconds; disabled if TIMEOUT '
242 'is negative or equals to zero')
243 group.add_argument('--wait', action='store_true',
244 help='wait for user input, e.g., allow a debugger '
245 'to be attached')
246 group.add_argument('-S', '--start', metavar='START',
247 help='resume an interrupted run at the following test.' +
248 more_details)
249 group.add_argument('-p', '--python', metavar='PYTHON',
250 help='Command to run Python test subprocesses with.')
251 group.add_argument('--randseed', metavar='SEED',
252 dest='random_seed', type=int,
253 help='pass a global random seed')
254
255 group = parser.add_argument_group('Verbosity')
256 group.add_argument('-v', '--verbose', action='count',
257 help='run tests in verbose mode with output to stdout')
258 group.add_argument('-w', '--rerun', action='store_true',
259 help='re-run failed tests in verbose mode')
260 group.add_argument('--verbose2', action='store_true', dest='rerun',
261 help='deprecated alias to --rerun')
262 group.add_argument('-W', '--verbose3', action='store_true',
263 help='display test output on failure')
264 group.add_argument('-q', '--quiet', action='store_true',
265 help='no output unless one or more tests fail')
266 group.add_argument('-o', '--slowest', action='store_true', dest='print_slow',
267 help='print the slowest 10 tests')
268 group.add_argument('--header', action='store_true',
269 help='print header with interpreter info')
270
271 group = parser.add_argument_group('Selecting tests')

Callers 1

_parse_argsFunction · 0.70

Calls 4

_ArgParserClass · 0.85
set_defaultsMethod · 0.45
add_argument_groupMethod · 0.45
add_argumentMethod · 0.45

Tested by

no test coverage detected