diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-23 09:24:27 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-23 09:24:27 -0400 |
commit | 1839a5c6da5b2d0e0a0ca0e3a1dec7b7bd983adc (patch) | |
tree | 35634d7717909dc95a6d58e697c76f6b814dd352 /coverage/control.py | |
parent | b5264460669282d5085b243de25d8f46be5c7ae9 (diff) | |
download | python-coveragepy-git-1839a5c6da5b2d0e0a0ca0e3a1dec7b7bd983adc.tar.gz |
Properly shift multiline references to the first line of the statement. This code is sloppy, I just want it to work first.
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/coverage/control.py b/coverage/control.py index da773d3e..76e17f65 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -354,17 +354,8 @@ class Analysis: # Identify missing statements. self.missing = [] self.executed = self.coverage.data.executed_lines(self.filename) - for line in self.statements: - lines = line_map.get(line) - if lines: - for l in range(lines[0], lines[1]+1): - if l in self.executed: - break - else: - self.missing.append(line) - else: - if line not in self.executed: - self.missing.append(line) + exec1 = self.parser._map_to_first_lines(self.executed) + self.missing = sorted(set(self.statements) - set(exec1)) def missing_formatted(self): return format_lines(self.statements, self.missing) @@ -373,7 +364,10 @@ class Analysis: return self.parser.arc_info() def arcs_executed(self): - return self.coverage.data.executed_arcs(self.filename) + executed = self.coverage.data.executed_arcs(self.filename) + m2fl = self.parser._map_to_first_line + executed = [(m2fl(l1), m2fl(l2)) for (l1,l2) in executed] + return executed def arcs_missing(self): possible = self.arc_possibilities() |