2 import unittest
, os
, sys
10 my_dir
= os
.path
.dirname(sys
.argv
[0])
16 suite_names
= [f
[:-3] for f
in os
.listdir(my_dir
)
17 if f
.startswith('test') and f
.endswith('.py')]
18 suite_names
.remove('testall')
21 alltests
= unittest
.TestSuite()
23 for name
in suite_names
:
24 m
= __import__(name
, globals(), locals(), [])
25 alltests
.addTest(m
.suite
)
27 a
= unittest
.TextTestRunner(verbosity
=2).run(alltests
)
32 print "Coverage module not found. Skipping coverage report."
35 if not a
.wasSuccessful():
41 for x
in os
.listdir(d
):
43 all_sources
.append(os
.path
.join(d
, x
))
45 coverage
.report(all_sources
+ ['../0publish'])