# HG changeset patch # User osimons # Date 1249080020 0 # Node ID 3e018dcb1b919424ab514a6138e78e3856ecfb76 # Parent 5d396356bf7adf411363fd4b5a4806e635ab6c16 0.6dev: Minor issue with `python:trace` where percentage was calculated based on covered lines as read from .cover file divided by code line count as read by `bitten.util.loc`. They obviously count code lines with some minor differences. Fixes #405. diff --git a/bitten/build/pythontools.py b/bitten/build/pythontools.py --- a/bitten/build/pythontools.py +++ b/bitten/build/pythontools.py @@ -301,7 +301,8 @@ elem.append(xmlio.Element('line_hits')[' '.join(lines)]) - num_lines = len(code_lines) + num_lines = not lines and len(code_lines) or \ + len([l for l in lines if l != '-']) if num_lines: percentage = int(round(num_covered * 100 / num_lines)) else: