Commits

Francisco Silvera committed 00371d9

added option to report in console and report in html at the same time

  • Participants
  • Parent commits 15fd7d2

Comments (0)

Files changed (2)

File django_coverage/coverage_runner.py

             coverage_modules, settings.COVERAGE_MODULE_EXCLUDES,
             settings.COVERAGE_PATH_EXCLUDES)
 
-        outdir = settings.COVERAGE_REPORT_HTML_OUTPUT_DIR
-        if outdir is None:
+        if settings.COVERAGE_REPORT :
             coverage.report(modules.values(), show_missing=1)
             if excludes:
                 message = "The following packages or modules were excluded:"
                 for e in errors:
                     print >>sys.stderr, e,
                 print >>sys.stdout
-        else:
+
+        outdir = settings.COVERAGE_REPORT_HTML_OUTPUT_DIR
+        if outdir:
             outdir = os.path.abspath(outdir)
             if settings.COVERAGE_CUSTOM_REPORTS:
                 html_report(outdir, modules, excludes, errors)

File django_coverage/settings.py

                                           'COVERAGE_REPORT_HTML_OUTPUT_DIR',
                                           None)
 
+COVERAGE_REPORT = getattr(settings, 'COVERAGE_REPORT', True)
+
 # True => html reports by 55minutes
 # False => html reports by coverage.py
 COVERAGE_CUSTOM_REPORTS = getattr(settings, 'COVERAGE_CUSTOM_REPORTS', True)