aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework
diff options
context:
space:
mode:
authorTom Christie2012-09-05 10:57:17 +0100
committerTom Christie2012-09-05 10:57:17 +0100
commit1eacc17957f3e50a917b1def96ec292510f5474d (patch)
tree2df9c4ab1387d9ec25a4a47d687e47b89e0533d1 /djangorestframework
parent3a17723bd579f4b340d03c29f98422546a755618 (diff)
downloaddjango-rest-framework-1eacc17957f3e50a917b1def96ec292510f5474d.tar.bz2
Clean up runcoverage
Diffstat (limited to 'djangorestframework')
-rwxr-xr-x[-rw-r--r--]djangorestframework/runtests/runcoverage.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/djangorestframework/runtests/runcoverage.py b/djangorestframework/runtests/runcoverage.py
index 0ab61479..4fa7cb8d 100644..100755
--- 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__':