diff options
-rwxr-xr-x | run_tests | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -21,8 +21,6 @@ import subprocess | |||
21 | import sys | 21 | import sys |
22 | from typing import List | 22 | from typing import List |
23 | 23 | ||
24 | import pytest | ||
25 | |||
26 | 24 | ||
27 | ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) | 25 | ROOT_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 | ||
44 | def run_pytest_py38(argv: List[str]) -> int: | 46 | def 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 | ||
82 | def run_flake8(): | 86 | def 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 | ||
89 | def run_isort(): | 95 | def 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 | ||