File: test.py

package info (click to toggle)
pocsuite3 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,996 kB
  • sloc: python: 16,816; asm: 911; java: 66; makefile: 30
file content (12 lines) | stat: -rw-r--r-- 427 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
import os
from unittest import TestLoader, TextTestRunner


if __name__ == '__main__':
    loader = TestLoader()
    tests_dir = os.path.join(os.path.dirname(__file__), 'tests')
    tests = loader.discover(tests_dir, pattern='test_*.py')
    runner = TextTestRunner()
    result = runner.run(tests)
    if result.failures or result.errors:
        raise SystemExit(f'{len(result.failures) + len(result.errors)} tests failed.')