-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_runner.py
More file actions
52 lines (41 loc) · 1.46 KB
/
Copy pathtest_runner.py
File metadata and controls
52 lines (41 loc) · 1.46 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
"""
Master test runner for the prune script.
This script runs all tests from the tests/ directory and provides a summary.
Usage: python test_runner.py
"""
import os
import sys
import subprocess
def main():
"""Run all tests from the tests directory."""
script_dir = os.path.dirname(os.path.abspath(__file__))
test_runner = os.path.join(script_dir, "tests", "run_all_tests.py")
if not os.path.exists(test_runner):
print("❌ Test runner not found at:", test_runner)
return 1
print("🧪 Running comprehensive test suite...")
print(f"📁 Test directory: {os.path.join(script_dir, 'tests')}")
print("=" * 60)
try:
# Determine which Python to use
# Try virtual environment first, fall back to system Python
venv_python = os.path.join(script_dir, "bin", "python")
if os.path.exists(venv_python):
python_cmd = venv_python
print(f"🐍 Using virtual environment Python: {python_cmd}")
else:
python_cmd = sys.executable
print(f"🐍 Using system Python: {python_cmd}")
print(f"📄 Running test suite: {test_runner}")
# Run the test suite
result = subprocess.run([
python_cmd,
test_runner
], cwd=script_dir)
return result.returncode
except Exception as e:
print(f"❌ Error running tests: {e}")
return 1
if __name__ == "__main__":
sys.exit(main())