Skip to content

Commit f499ba8

Browse files
committed
Started the code coverage measurements earlier, in order to make the apparent code coverage of model files less confusing.
- Legacy-Id: 9188
1 parent f15e515 commit f499ba8

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

ietf/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ def skip_unreadable_post(record):
289289
TEST_COVERAGE_MASTER_FILE = "release-coverage.json"
290290
TEST_COVERAGE_LATEST_FILE = "latest-coverage.json"
291291

292+
COVERAGE_CHECKER = None
293+
if SERVER_MODE != 'production':
294+
import coverage
295+
COVERAGE_CHECKER = coverage.coverage(source=[ BASE_DIR ], cover_pylib=False, omit=TEST_CODE_COVERAGE_EXCLUDE)
296+
COVERAGE_CHECKER.start()
297+
292298
# WG Chair configuration
293299
MAX_WG_DELEGATES = 3
294300

ietf/utils/test_runner.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ def setup_test_environment(self, **kwargs):
341341
settings.TEMPLATE_LOADERS = ('ietf.utils.test_runner.template_coverage_loader',) + settings.TEMPLATE_LOADERS
342342
settings.MIDDLEWARE_CLASSES = ('ietf.utils.test_runner.RecordUrlsMiddleware',) + settings.MIDDLEWARE_CLASSES
343343

344-
self.code_coverage_checker = coverage.coverage(source=[ settings.BASE_DIR ], cover_pylib=False, omit=settings.TEST_CODE_COVERAGE_EXCLUDE)
345-
self.code_coverage_checker.start()
344+
self.code_coverage_checker = settings.COVERAGE_CHECKER
346345

347346
if settings.SITE_ID != 1:
348347
print " Changing SITE_ID to '1' during testing."

0 commit comments

Comments
 (0)