-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.py
More file actions
executable file
·47 lines (36 loc) · 1.16 KB
/
run_tests.py
File metadata and controls
executable file
·47 lines (36 loc) · 1.16 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
#!/usr/bin/env python3
"""
Shell Test Runner - A simple script to run tests for the shell implementation.
"""
import sys
import subprocess
def run_tests():
"""Run all shell tests."""
print("🧪 Running Shell Test Suite")
print("=" * 50)
try:
# Run pytest with verbose output
result = subprocess.run([
"pipenv", "run", "python", "-m", "pytest",
"-v", "--tb=short", "--color=yes"
], check=True)
print("\n✅ All tests passed!")
return True
except subprocess.CalledProcessError as e:
print(f"\n❌ Tests failed with exit code {e.returncode}")
return False
except FileNotFoundError:
print("❌ pipenv not found. Please install pipenv first:")
print(" pip install pipenv")
return False
def main():
"""Main entry point."""
if len(sys.argv) > 1 and sys.argv[1] in ["-h", "--help"]:
print("Shell Test Runner")
print("Usage: python run_tests.py")
print(" python run_tests.py --help")
return
success = run_tests()
sys.exit(0 if success else 1)
if __name__ == "__main__":
main()