aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/run_tests.py
blob: b776062ea20673fee575a7d0d4f205ebf98310f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys
import unittest
from pathlib import Path

src_path = Path(__file__).parent.parent / "src"
sys.path.insert(0, str(src_path))


def run_all_tests():
    loader = unittest.TestLoader()
    
    suite = loader.discover(
        start_dir=Path(__file__).parent,
        pattern='test_*.py'
    )
    
    runner = unittest.TextTestRunner(verbosity=2)
    result = runner.run(suite)
    
    return 0 if result.wasSuccessful() else 1


if __name__ == "__main__":
    sys.exit(run_all_tests())