Commits

Atamert Ölçgen committed 11203f1

Made coverage caching (data file) configurable

  • Participants
  • Parent commits b760820

Comments (0)

Files changed (2)

django_coverage/coverage_runner.py

         return '.'.join(app_model_module.__name__.split('.')[:-1])
 
     def run_tests(self, test_labels, extra_tests=None, **kwargs):
-        coverage.use_cache(0)
+        coverage.use_cache(settings.COVERAGE_USE_CACHE)
         for e in settings.COVERAGE_CODE_EXCLUDES:
             coverage.exclude(e)
         coverage.start()

django_coverage/settings.py

 COVERAGE_TEST_RUNNER = getattr(settings, 'COVERAGE_TEST_RUNNER',
                              'django_coverage.coverage_runner.CoverageRunner')
 
+# Specify whether coverage data file is created or not.
+COVERAGE_USE_CACHE = getattr(settings, 'COVERAGE_USE_CACHE', False)
+
 # Specify regular expressions of code blocks the coverage analyzer should
 # ignore as statements (e.g. ``raise NotImplemented``).
 # These statements are not figured in as part of the coverage statistics.
 # This setting is optional.
-
 COVERAGE_CODE_EXCLUDES = getattr(settings, 'COVERAGE_CODE_EXCLUDES',[
                                     'def __unicode__\(self\):',
                                     'def get_absolute_url\(self\):',