File size: 1,065 Bytes
94ddfa7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python
"""
Simple test runner script for the Deepfake Detection Service.
Run this file to execute all tests with proper output formatting.
"""

import sys
import subprocess
from pathlib import Path


def run_tests():
    """Run all tests with pytest."""
    print("=" * 70)
    print("🧪 Deepfake Detection Service - Test Suite")
    print("=" * 70)
    
    backend_dir = Path(__file__).parent
    
    # Run tests with verbose output
    cmd = [
        sys.executable,
        "-m",
        "pytest",
        "tests/",
        "-v",
        "--tb=short",
        "-ra"  # Show summary of all test outcomes
    ]
    
    print(f"\n📝 Running command: {' '.join(cmd)}\n")
    
    result = subprocess.run(cmd, cwd=backend_dir)
    
    print("\n" + "=" * 70)
    if result.returncode == 0:
        print("✅ All tests passed!")
    else:
        print("❌ Some tests failed. See output above for details.")
    print("=" * 70)
    
    return result.returncode


if __name__ == "__main__":
    exit_code = run_tests()
    sys.exit(exit_code)