From 1eacc17957f3e50a917b1def96ec292510f5474d Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 5 Sep 2012 10:57:17 +0100 Subject: [PATCH] Clean up runcoverage --- djangorestframework/runtests/runcoverage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 djangorestframework/runtests/runcoverage.py diff --git a/djangorestframework/runtests/runcoverage.py b/djangorestframework/runtests/runcoverage.py old mode 100644 new mode 100755 index 0ab614797..4fa7cb8db --- a/djangorestframework/runtests/runcoverage.py +++ b/djangorestframework/runtests/runcoverage.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python """ Useful tool to run the test suite for djangorestframework and generate a coverage report. """ @@ -10,7 +11,7 @@ import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'djangorestframework.runtests.settings' from coverage import coverage -from itertools import chain + def main(): """Run the tests for djangorestframework and generate a coverage report.""" @@ -57,7 +58,8 @@ def main(): cov_files.extend([os.path.join(path, file) for file in files if file.endswith('.py')]) cov.report(cov_files) - cov.xml_report(cov_files) + if '--html' in sys.argv: + cov.html_report(cov_files, directory='coverage') sys.exit(failures) if __name__ == '__main__':