From 858721a9d5a3618b80d10ec71c6c2c32a89b6a7c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 13 Mar 2009 08:00:24 -0400 Subject: No need for coverage.analysis to return the filename, it's a property on the CodeUnit passed in. --- coverage/control.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'coverage/control.py') diff --git a/coverage/control.py b/coverage/control.py index 240a75f3..db9b0a6d 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -100,16 +100,18 @@ class coverage: return f, s, m, mf def analysis2(self, morf): - code_units = code_unit_factory(morf, self.file_locator) - return self.analyze(code_units[0]) + code_unit = code_unit_factory(morf, self.file_locator)[0] + st, ex, m, mf = self.analyze(code_unit) + return code_unit.filename, st, ex, m, mf def analyze(self, code_unit): """Analyze a single code unit. - Otherwise, return a tuple of (1) the canonical filename of the source - code for the module, (2) a list of lines of statements in the source - code, (3) a list of lines of excluded statements, (4) a list of lines - missing from execution, and (5), a readable string of missing lines. + Returns a tuple of: + - a list of lines of statements in the source code, + - a list of lines of excluded statements, + - a list of lines missing from execution, and + - a readable string of missing lines. """ from coverage.parser import CodeParser @@ -149,9 +151,8 @@ class coverage: else: if line not in execed: missing.append(line) - - return (filename, statements, excluded, missing, - format_lines(statements, missing)) + + return (statements, excluded, missing, format_lines(statements, missing)) def report(self, morfs, show_missing=True, ignore_errors=False, file=None): """Write a summary report to `file`. -- cgit v1.2.1