summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrun_tests18
1 files changed, 13 insertions, 5 deletions
diff --git a/run_tests b/run_tests
index ef7c04b7..d64cc700 100755
--- a/run_tests
+++ b/run_tests
@@ -21,8 +21,6 @@ import subprocess
21import sys 21import sys
22from typing import List 22from typing import List
23 23
24import pytest
25
26 24
27ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) 25ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
28 26
@@ -38,7 +36,11 @@ def run_pytest(argv: List[str]) -> int:
38 if is_ci(): 36 if is_ci():
39 argv = ["-m", "not skip_cq"] + argv 37 argv = ["-m", "not skip_cq"] + argv
40 38
41 return pytest.main(argv) 39 return subprocess.run(
40 [sys.executable, "-m", "pytest"] + argv,
41 check=False,
42 cwd=ROOT_DIR,
43 ).returncode
42 44
43 45
44def run_pytest_py38(argv: List[str]) -> int: 46def run_pytest_py38(argv: List[str]) -> int:
@@ -57,6 +59,7 @@ def run_pytest_py38(argv: List[str]) -> int:
57 ] 59 ]
58 + argv, 60 + argv,
59 check=False, 61 check=False,
62 cwd=ROOT_DIR,
60 ).returncode 63 ).returncode
61 except FileNotFoundError: 64 except FileNotFoundError:
62 # Skip if the user doesn't have vpython from depot_tools. 65 # Skip if the user doesn't have vpython from depot_tools.
@@ -76,20 +79,25 @@ def run_black():
76 return subprocess.run( 79 return subprocess.run(
77 [sys.executable, "-m", "black", "--check", ROOT_DIR] + extra_programs, 80 [sys.executable, "-m", "black", "--check", ROOT_DIR] + extra_programs,
78 check=False, 81 check=False,
82 cwd=ROOT_DIR,
79 ).returncode 83 ).returncode
80 84
81 85
82def run_flake8(): 86def run_flake8():
83 """Returns the exit code from flake8.""" 87 """Returns the exit code from flake8."""
84 return subprocess.run( 88 return subprocess.run(
85 [sys.executable, "-m", "flake8", ROOT_DIR], check=False 89 [sys.executable, "-m", "flake8", ROOT_DIR],
90 check=False,
91 cwd=ROOT_DIR,
86 ).returncode 92 ).returncode
87 93
88 94
89def run_isort(): 95def run_isort():
90 """Returns the exit code from isort.""" 96 """Returns the exit code from isort."""
91 return subprocess.run( 97 return subprocess.run(
92 [sys.executable, "-m", "isort", "--check", ROOT_DIR], check=False 98 [sys.executable, "-m", "isort", "--check", ROOT_DIR],
99 check=False,
100 cwd=ROOT_DIR,
93 ).returncode 101 ).returncode
94 102
95 103