MCPcopy
hub / github.com/python/mypy / main

Function main

runtests.py:151–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149
150
151def main() -> None:
152 prog, *args = argv
153
154 if not set(args).issubset(cmds):
155 print(
156 "usage:",
157 prog,
158 " ".join(f"[{k}]" for k in cmds),
159 "[names of individual tests and files...]",
160 )
161 print()
162 print(
163 "Run the given tests. If given no arguments, run everything except"
164 + " pytest-extra and mypyc-extra. Unrecognized arguments will be"
165 + " interpreted as individual test names / substring expressions"
166 + " (or, if they end in .test, individual test files)"
167 + " and this script will try to run them."
168 )
169 if "-h" in args or "--help" in args:
170 exit(1)
171
172 if not args:
173 args = DEFAULT_COMMANDS.copy()
174
175 status = 0
176
177 if "self" in args and "lint" in args:
178 # Perform lint and self check in parallel as it's faster.
179 proc = start_background_cmd("lint")
180 cmd_status = run_cmd("self")
181 if cmd_status:
182 status = cmd_status
183 cmd_status = wait_background_cmd("lint", proc)
184 if cmd_status:
185 status = cmd_status
186 args = [arg for arg in args if arg not in ("self", "lint")]
187
188 for arg in args:
189 cmd_status = run_cmd(arg)
190 if cmd_status:
191 status = cmd_status
192
193 exit(status)
194
195
196if __name__ == "__main__":

Callers 1

runtests.pyFile · 0.70

Calls 8

setClass · 0.85
printFunction · 0.85
exitFunction · 0.85
start_background_cmdFunction · 0.85
wait_background_cmdFunction · 0.85
run_cmdFunction · 0.70
joinMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…