()
| 149 | |
| 150 | |
| 151 | def 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 | |
| 196 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…