Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def run_cmd(name: str) -> int:
cmd = ["pytest", f"mypy/test/testcheck.py::TypeCheckSuite::{name}"]
else:
cmd = ["pytest", "-n0", "-k", name]
if cmd[0] == "pytest" and "--update-data" in argv:
cmd += ["--update-data"]
print(f"run {name}: {cmd}")
proc = subprocess.run(cmd, stderr=subprocess.STDOUT)
if proc.returncode:
Expand Down Expand Up @@ -163,6 +165,7 @@ def main() -> None:
+ " interpreted as individual test names / substring expressions"
+ " (or, if they end in .test, individual test files)"
+ " and this script will try to run them."
+ " A flag of --update-data will be propagated through to all pytest commands."
)
if "-h" in args or "--help" in args:
exit(1)
Expand All @@ -184,9 +187,10 @@ def main() -> None:
args = [arg for arg in args if arg not in ("self", "lint")]

for arg in args:
cmd_status = run_cmd(arg)
if cmd_status:
status = cmd_status
if arg != "--update-data":
cmd_status = run_cmd(arg)
if cmd_status:
status = cmd_status

exit(status)

Expand Down
Loading