MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / parse_args

Function parse_args

tests/runner.py:88–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87
88def parse_args():
89 parser = argparse.ArgumentParser(description="Runner for MONAI unittests with timing.")
90 parser.add_argument(
91 "-s", action="store", dest="path", default=".", help="Directory to start discovery (default: '%(default)s')"
92 )
93 parser.add_argument(
94 "-p",
95 action="store",
96 dest="pattern",
97 default="test_*.py",
98 help="Pattern to match tests (default: '%(default)s')",
99 )
100 parser.add_argument(
101 "-t",
102 "--thresh",
103 dest="thresh",
104 default=10.0,
105 type=float,
106 help="Display tests longer than given threshold (default: %(default)d)",
107 )
108 parser.add_argument(
109 "-v",
110 "--verbosity",
111 action="store",
112 dest="verbosity",
113 type=int,
114 default=1,
115 help="Verbosity level (default: %(default)d)",
116 )
117 parser.add_argument("-q", "--quick", action="store_true", dest="quick", default=False, help="Only do quick tests")
118 parser.add_argument(
119 "-f", "--failfast", action="store_true", dest="failfast", default=False, help="Stop testing on first failure"
120 )
121 parser.add_argument(
122 "--timeout",
123 dest="timeout",
124 default=0,
125 type=int,
126 help="Per-test timeout in seconds; 0 disables (default: %(default)d). Requires SIGALRM (Linux/macOS only).",
127 )
128 args = parser.parse_args()
129 print(f"Running tests in folder: '{args.path}'")
130 if args.pattern:
131 print(f"With file pattern: '{args.pattern}'")
132
133 return args
134
135
136def get_default_pattern(loader):

Callers 1

runner.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…