@manager.command
def cov():
 cov = coverage.coverage(branch=True, include='project/*')
 cov.start()
 tests = unittest.TestLoader().discover('tests')
 unittest.TextTestRunner(verbosity=2).run(tests)
 cov.stop()
 cov.save()
 print 'Coverage Summary:'
 cov.report()
 basedir = os.path.abspath(os.path.dirname(__file__))
 covdir = os.path.join(basedir, 'coverage')
 cov.html_report(directory=covdir)
 cov.erase()

@ manager . command def cov ( ) : cov = coverage . coverage ( branch = True , include = 'project/*' ) cov . start ( ) tests = unittest . TestLoader ( ) . discover ( 'tests' ) unittest . TextTestRunner ( verbosity = 2 ) . run ( tests ) cov . stop ( ) cov . save ( ) print 'Coverage Summary:' cov . report ( ) basedir = os . path . abspath ( os . path . dirname ( __file__ ) ) covdir = os . path . join ( basedir , 'coverage' ) cov . html_report ( directory = covdir ) cov . erase ( )
runs the unit tests with coverage .