in testslide/cli.py [0:0]
def _build_parser(self, disable_test_files: bool) -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(description="TestSlide")
parser.add_argument(
"-f",
"--format",
choices=self.FORMAT_NAME_TO_FORMATTER_CLASS.keys(),
default="documentation",
help="Configure output format. Default: %(default)s",
)
parser.add_argument(
"--force-color",
action="store_true",
help="Force color output even without a terminal",
)
parser.add_argument(
"--shuffle", action="store_true", help="Randomize example execution order"
)
parser.add_argument(
"-l", "--list", action="store_true", help="List all tests one per line"
)
parser.add_argument(
"--seed",
nargs=1,
type=int,
help="Positive number to seed shuffled examples",
)
parser.add_argument(
"--focus",
action="store_true",
help="Only executed focused examples, or all if none focused",
)
parser.add_argument(
"--fail-if-focused",
action="store_true",
help="Raise an error if an example is focused. Useful when running tests in a continuous integration environment.",
)
parser.add_argument(
"--fail-fast",
action="store_true",
help="Stop execution when an example fails",
)
parser.add_argument(
"--filter-text",
nargs=1,
type=str,
help="Only execute examples that include given text in their names",
)
parser.add_argument(
"--filter-regex",
nargs=1,
type=self._regex_type,
help="Only execute examples which match given regex",
)
parser.add_argument(
"--exclude-regex",
nargs=1,
type=self._regex_type,
help="Exclude examples which match given regex from being executed",
)
parser.add_argument(
"--quiet",
action="store_true",
help="Suppress output (stdout and stderr) of tested code",
)
parser.add_argument(
"--dsl-debug",
action="store_true",
help=(
"Print debugging information during execution of TestSlide's "
"DSL tests."
),
)
parser.add_argument(
"--trim-path-prefix",
nargs=1,
type=str,
default=[self._default_trim_path_prefix],
help=(
"Remove the specified prefix from paths in some of the output. "
"Default: {}".format(repr(self._default_trim_path_prefix))
),
)
parser.add_argument(
"--show-testslide-stack-trace",
default=False,
action="store_true",
help=(
"TestSlide's own code is trimmed from stack traces by default. "
"This flags disables that, useful for TestSlide's own development."
),
)
parser.add_argument(
"--import-profiler",
nargs=1,
type=int,
default=None,
help=(
"Print profiling information slow import time for modules that took "
"more than the given number of ms to import. Experimental."
),
)
if not disable_test_files:
parser.add_argument(
"test_files",
nargs="+",
type=str,
default=[],
help=(
"List of file paths that contain either unittes.TestCase "
"tests and/or TestSlide's DSL tests."
),
)
return parser