Skip to content

Commit b4c25a0

Browse files
Fix a bug where runtests.py didn't run non-testcheck .test files individually 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.
1 parent 88a3c58 commit b4c25a0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

runtests.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ def run_cmd(name: str) -> int:
114114
if name in cmds:
115115
cmd = cmds[name]
116116
else:
117-
if name.endswith(".test"):
118-
cmd = ["pytest", f"mypy/test/testcheck.py::TypeCheckSuite::{name}"]
119-
else:
120-
cmd = ["pytest", "-n0", "-k", name]
117+
cmd = ["pytest", "-n0", "-k", name]
121118
print(f"run {name}: {cmd}")
122119
proc = subprocess.run(cmd, stderr=subprocess.STDOUT)
123120
if proc.returncode:
@@ -161,7 +158,7 @@ def main() -> None:
161158
"Run the given tests. If given no arguments, run everything except"
162159
+ " pytest-extra and mypyc-extra. Unrecognized arguments will be"
163160
+ " interpreted as individual test names / substring expressions"
164-
+ " (or, if they end in .test, individual test files)"
161+
+ " (which can end in .test, to specify individual test files)"
165162
+ " and this script will try to run them."
166163
)
167164
if "-h" in args or "--help" in args:

0 commit comments

Comments
 (0)