Skip to content

Commit b898049

Browse files
committed
Merge remote-tracking branch 'origin/master' into sync-fork-1
2 parents 0825056 + 153a0ca commit b898049

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

django_coverage_plugin/plugin.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def __init__(self, options):
120120

121121
self.exclude_blocks = options.get("exclude_blocks")
122122

123+
self.exclude_blocks = options.get("exclude_blocks")
124+
123125
self.debug_checked = False
124126

125127
self.django_template_dir = os.path.normcase(os.path.realpath(
@@ -334,6 +336,12 @@ def lines(self):
334336
self._excluded.add(token.lineno)
335337
continue
336338

339+
# Ignore any block token content that has been explcitly
340+
# excluded in config
341+
if self.exclude_block_token(token):
342+
self._excluded.add(token.lineno)
343+
continue
344+
337345
if token.contents == "comment":
338346
comment = True
339347
if token.contents.startswith("end"):
@@ -371,13 +379,17 @@ def lines(self):
371379

372380
return source_lines
373381

382+
374383
def excluded_lines(self):
375384
return self._excluded
376385

377386
def exclude_block_token(self, token):
378387
if self.exclude_blocks_regex:
379388
return self.exclude_blocks_regex.search(token.contents)
389+
<<<<<<< HEAD
380390

391+
=======
392+
>>>>>>> origin/master
381393

382394
def running_sum(seq):
383395
total = 0

0 commit comments

Comments
 (0)