Files
cibuildwheel/bin/run_tests.py
T
Matthieu DarboisandJoe Rickerby ab13f7a9de feature: allow local runs on windows/macOS (#974)
* feature: allow local runs on windows/macOS

Cache python installations to a user cache folder using platformdirs.
The build environment is now a virtual environment to allow proper isolation.
Allows to run tests in parallel.

Co-authored-by: Joe Rickerby <joerick@mac.com>
2022-01-08 11:30:48 +01:00

34 lines
783 B
Python
Executable File

#!/usr/bin/env python3
import os
import subprocess
import sys
from pathlib import Path
if __name__ == "__main__":
# move cwd to the project root
os.chdir(Path(__file__).resolve().parents[1])
# run the unit tests
unit_test_args = [sys.executable, "-m", "pytest", "unit_test"]
# run the docker unit tests only on Linux
if sys.platform.startswith("linux"):
unit_test_args += ["--run-docker"]
subprocess.run(unit_test_args, check=True)
# run the integration tests
subprocess.run(
[
sys.executable,
"-m",
"pytest",
"--numprocesses=2",
"-x",
"--durations",
"0",
"--timeout=2400",
"test",
],
check=True,
)