Implement test coverage for app
This commit is contained in:
@@ -37,15 +37,22 @@ except ImportError:
|
||||
|
||||
|
||||
def run_tests(*test_args):
|
||||
from coverage import Coverage
|
||||
|
||||
cov = Coverage()
|
||||
if not test_args:
|
||||
test_args = ['ai_blocker.tests']
|
||||
|
||||
TestRunner = get_runner(settings)
|
||||
test_runner = TestRunner()
|
||||
cov.start()
|
||||
failures = test_runner.run_tests(test_args)
|
||||
cov.stop()
|
||||
if failures:
|
||||
sys.exit(failures)
|
||||
|
||||
cov.html_report()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_tests(*sys.argv[1:])
|
||||
Reference in New Issue
Block a user