-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.py
More file actions
50 lines (40 loc) · 1.42 KB
/
run_tests.py
File metadata and controls
50 lines (40 loc) · 1.42 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
#!/usr/bin/env python3
"""
Test runner for TagManager
"""
import unittest
import sys
import os
# Add the project root to Python path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
def run_tests():
"""Run all tests"""
print("🧪 TagManager Comprehensive Test Suite")
print("=" * 50)
# Discover and run tests
loader = unittest.TestLoader()
start_dir = os.path.join(os.path.dirname(__file__), 'tests')
suite = loader.discover(start_dir, pattern='test_*.py')
# Count total tests
total_tests = suite.countTestCases()
print(f"📋 Running {total_tests} tests across all service modules...")
print()
# Run tests with verbose output
runner = unittest.TextTestRunner(verbosity=2, buffer=True)
result = runner.run(suite)
# Print summary
print("\n" + "=" * 50)
print("📊 Test Summary:")
print(f" ✅ Tests run: {result.testsRun}")
print(f" ❌ Failures: {len(result.failures)}")
print(f" 💥 Errors: {len(result.errors)}")
print(f" ⏭️ Skipped: {len(result.skipped) if hasattr(result, 'skipped') else 0}")
if result.wasSuccessful():
print("🎉 All tests passed!")
else:
print("⚠️ Some tests failed. See details above.")
# Return exit code based on test results
return 0 if result.wasSuccessful() else 1
if __name__ == '__main__':
exit_code = run_tests()
sys.exit(exit_code)