more refactoring

This commit is contained in:
William Kray
2025-09-09 14:49:45 -07:00
parent 6582112dfb
commit 87e02b7ea6
28 changed files with 4664 additions and 894 deletions
Executable
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env python3
"""Test runner for the community bot project."""
import sys
import subprocess
import os
def run_tests():
"""Run all tests for the community bot project."""
print("Running community bot tests...")
# Change to the project directory
project_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(project_dir)
# Run pytest
try:
result = subprocess.run([
sys.executable, "-m", "pytest",
"tests/",
"-v",
"--tb=short",
"--color=yes"
], check=True)
print("\n✅ All tests passed!")
return 0
except subprocess.CalledProcessError as e:
print(f"\n❌ Tests failed with exit code {e.returncode}")
return e.returncode
except FileNotFoundError:
print("❌ pytest not found. Please install it with: pip install pytest")
return 1
if __name__ == "__main__":
sys.exit(run_tests())