Runs the unit tests with coverage.
()
| 25 | |
| 26 | @manager.command |
| 27 | def cov(): |
| 28 | """Runs the unit tests with coverage.""" |
| 29 | cov = coverage.coverage( |
| 30 | branch=True, |
| 31 | include='project/*' |
| 32 | ) |
| 33 | cov.start() |
| 34 | tests = unittest.TestLoader().discover('tests') |
| 35 | unittest.TextTestRunner(verbosity=2).run(tests) |
| 36 | cov.stop() |
| 37 | cov.save() |
| 38 | print 'Coverage Summary:' |
| 39 | cov.report() |
| 40 | basedir = os.path.abspath(os.path.dirname(__file__)) |
| 41 | covdir = os.path.join(basedir, 'coverage') |
| 42 | cov.html_report(directory=covdir) |
| 43 | cov.erase() |
| 44 | |
| 45 | |
| 46 | if __name__ == '__main__': |
nothing calls this directly
no outgoing calls
no test coverage detected