-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
34 lines (24 loc) · 657 Bytes
/
test.py
File metadata and controls
34 lines (24 loc) · 657 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
29
30
31
32
33
34
import sys
import unittest
sys.path.append('test')
sys.path.append('test/lib')
try:
import coverage
covering = True
except:
covering = False
print 'No coverage'
if covering:
cov = coverage.coverage(branch=True,
config_file = 'test/.coveragerc',
data_file = 'test/coverage/.coverage'
)
cov.start()
import test
loader = unittest.TestLoader()
suite = unittest.TestSuite(loader.loadTestsFromModule(test))
unittest.TextTestRunner(verbosity=1).run(suite)
if covering:
cov.stop()
cov.save()
cov.html_report(directory='test/coverage')