-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathrun_tests.py
More file actions
28 lines (22 loc) · 702 Bytes
/
run_tests.py
File metadata and controls
28 lines (22 loc) · 702 Bytes
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
# usage:
# run_tests.py [PYTEST_ARGS]
import os
import subprocess
import sys
from coverage import Coverage
SHELL = sys.platform == 'win32'
if __name__ == '__main__':
command = ['py.test', '-n', '0']
if os.environ.get('WITH_COVERAGE') == '1':
command.extend(['--cov=rinoh', '--cov-report='])
if os.environ.get('BASETEMP'):
command.append('--basetemp={}'.format(os.environ['BASETEMP']))
command.extend(sys.argv[1:])
rc = subprocess.call(command, shell=SHELL)
if os.environ.get('WITH_COVERAGE') == '1':
cov = Coverage()
cov.load()
cov.combine()
cov.report(skip_covered=True)
cov.xml_report()
raise SystemExit(rc)