Skip to content

Commit 96d7d77

Browse files
authored
mypy_test_suite: run a subset of tests (#4723)
Only a subset of mypy's test suite should be relevant to typeshed: python/mypy#9638 This should make things faster. (Also the -n12 argument to pytest is weird; note mypy's pytest.ini automatically specificies -nauto which is what we should want) Resolves #4333 Co-authored-by: hauntsaninja <>
1 parent 75a92eb commit 96d7d77

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/mypy_test_suite.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
if __name__ == "__main__":
1111
with tempfile.TemporaryDirectory() as tempdir:
1212
dirpath = Path(tempdir)
13+
subprocess.run(["git", "clone", "--depth", "1", "git://github.com/python/mypy", dirpath / "mypy"], check=True)
14+
1315
subprocess.run(["python2.7", "-m", "pip", "install", "--user", "typing"], check=True)
14-
subprocess.run(["git", "clone", "--depth", "1", "git://github.com/python/mypy", str(dirpath / "mypy")], check=True)
1516
subprocess.run(
16-
[sys.executable, "-m", "pip", "install", "-U", "-r", str(dirpath / "mypy/test-requirements.txt")], check=True
17+
[sys.executable, "-m", "pip", "install", "-U", "-r", dirpath / "mypy/test-requirements.txt"], check=True
1718
)
18-
shutil.copytree("stdlib", str(dirpath / "mypy/mypy/typeshed/stdlib"))
19-
shutil.copytree("third_party", str(dirpath / "mypy/mypy/typeshed/third_party"))
19+
shutil.copytree("stdlib", dirpath / "mypy/mypy/typeshed/stdlib")
20+
shutil.copytree("third_party", dirpath / "mypy/mypy/typeshed/third_party")
2021
try:
21-
subprocess.run(["pytest", "-n12"], cwd=str(dirpath / "mypy"), check=True)
22+
subprocess.run([sys.executable, "runtests.py", "typeshed-ci"], cwd=dirpath / "mypy", check=True)
2223
except subprocess.CalledProcessError as e:
2324
print("mypy tests failed", file=sys.stderr)
2425
sys.exit(e.returncode)

0 commit comments

Comments
 (0)