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
Fix a bug where runtests.py didn't run non-testcheck .test files indi…
…vidually when asked to

Due to the way I wrote this feature, generalizing too narrowly from the CONTRIBUTING.md example, you actually could only run testcheck files this way. Luckily, the fix is as simple as not specifying some extra stuff! Since the test file name is in whatever string -k checks against.
  • Loading branch information
wyattscarpenter committed Dec 11, 2025
commit b4c25a030b165bffebaa4af7f34a6910e5354b70
7 changes: 2 additions & 5 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ def run_cmd(name: str) -> int:
if name in cmds:
cmd = cmds[name]
else:
if name.endswith(".test"):
cmd = ["pytest", f"mypy/test/testcheck.py::TypeCheckSuite::{name}"]
else:
cmd = ["pytest", "-n0", "-k", name]
cmd = ["pytest", "-n0", "-k", name]
print(f"run {name}: {cmd}")
proc = subprocess.run(cmd, stderr=subprocess.STDOUT)
if proc.returncode:
Expand Down Expand Up @@ -161,7 +158,7 @@ def main() -> None:
"Run the given tests. If given no arguments, run everything except"
+ " pytest-extra and mypyc-extra. Unrecognized arguments will be"
+ " interpreted as individual test names / substring expressions"
+ " (or, if they end in .test, individual test files)"
+ " (which can end in .test, to specify individual test files)"
+ " and this script will try to run them."
)
if "-h" in args or "--help" in args:
Expand Down