-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathrun_tests.py
More file actions
executable file
·35 lines (27 loc) · 1000 Bytes
/
run_tests.py
File metadata and controls
executable file
·35 lines (27 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
"""
Simple test runner for solc-select.
This script provides an easy way to run the pytest test suite
with appropriate options.
"""
import subprocess
import sys
def main() -> int:
"""Run the test suite."""
# Basic pytest command
cmd = [sys.executable, "-m", "pytest", "tests/", "-v"]
# Add platform-specific marker based on current platform
if sys.platform == "linux":
# Run all non-Windows, non-macOS tests plus Linux tests
cmd.extend(["-m", "not (windows or macos)"])
elif sys.platform == "darwin":
# Run all non-Windows, non-Linux tests plus macOS tests
cmd.extend(["-m", "not (windows or linux)"])
elif sys.platform == "win32":
# Run all non-Linux, non-macOS tests plus Windows tests
cmd.extend(["-m", "not (linux or macos)"])
print(f"Running: {' '.join(cmd)}")
result = subprocess.run(cmd, check=False)
return result.returncode
if __name__ == "__main__":
sys.exit(main())