diff --git a/runtests.py b/runtests.py index 3f49107f3ce0..189c80ac1db7 100755 --- a/runtests.py +++ b/runtests.py @@ -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: @@ -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) @@ -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)