summaryrefslogtreecommitdiffstats
path: root/run_tests
diff options
context:
space:
mode:
Diffstat (limited to 'run_tests')
-rwxr-xr-xrun_tests23
1 files changed, 23 insertions, 0 deletions
diff --git a/run_tests b/run_tests
index 20dad8da..ef7c04b7 100755
--- a/run_tests
+++ b/run_tests
@@ -41,6 +41,28 @@ def run_pytest(argv: List[str]) -> int:
41 return pytest.main(argv) 41 return pytest.main(argv)
42 42
43 43
44def run_pytest_py38(argv: List[str]) -> int:
45 """Returns the exit code from pytest under Python 3.8."""
46 if is_ci():
47 argv = ["-m", "not skip_cq"] + argv
48
49 try:
50 return subprocess.run(
51 [
52 "vpython3",
53 "-vpython-spec",
54 "run_tests.vpython3.8",
55 "-m",
56 "pytest",
57 ]
58 + argv,
59 check=False,
60 ).returncode
61 except FileNotFoundError:
62 # Skip if the user doesn't have vpython from depot_tools.
63 return 0
64
65
44def run_black(): 66def run_black():
45 """Returns the exit code from black.""" 67 """Returns the exit code from black."""
46 # Black by default only matches .py files. We have to list standalone 68 # Black by default only matches .py files. We have to list standalone
@@ -75,6 +97,7 @@ def main(argv):
75 """The main entry.""" 97 """The main entry."""
76 checks = ( 98 checks = (
77 functools.partial(run_pytest, argv), 99 functools.partial(run_pytest, argv),
100 functools.partial(run_pytest_py38, argv),
78 run_black, 101 run_black,
79 run_flake8, 102 run_flake8,
80 run_isort, 103 run_isort,