|
|
@ -6599,15 +6599,14 @@ def unset_envs(): |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
def main(): |
|
|
|
unset_envs() |
|
|
|
unset_envs() |
|
|
|
pytest_args = ['-n', 'auto', './run_unittests.py'] |
|
|
|
|
|
|
|
if shutil.which('pytest-3'): |
|
|
|
|
|
|
|
return subprocess.run(['pytest-3'] + pytest_args).returncode |
|
|
|
|
|
|
|
elif shutil.which('pytest'): |
|
|
|
|
|
|
|
return subprocess.run(['pytest'] + pytest_args).returncode |
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
import pytest # noqa: F401 |
|
|
|
import pytest # noqa: F401 |
|
|
|
|
|
|
|
# Need pytest-xdist for `-n` arg |
|
|
|
|
|
|
|
import xdist # noqa: F401 |
|
|
|
|
|
|
|
pytest_args = ['-n', 'auto', './run_unittests.py'] |
|
|
|
return subprocess.run(python_command + ['-m', 'pytest'] + pytest_args).returncode |
|
|
|
return subprocess.run(python_command + ['-m', 'pytest'] + pytest_args).returncode |
|
|
|
except ImportError: |
|
|
|
except ImportError: |
|
|
|
|
|
|
|
print('pytest-xdist not found, using unittest instead') |
|
|
|
pass |
|
|
|
pass |
|
|
|
# All attempts at locating pytest failed, fall back to plain unittest. |
|
|
|
# All attempts at locating pytest failed, fall back to plain unittest. |
|
|
|
cases = ['InternalTests', 'DataTests', 'AllPlatformTests', 'FailureTests', |
|
|
|
cases = ['InternalTests', 'DataTests', 'AllPlatformTests', 'FailureTests', |
|
|
|