diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-03-13 08:00:24 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-03-13 08:00:24 -0400 |
commit | 858721a9d5a3618b80d10ec71c6c2c32a89b6a7c (patch) | |
tree | 421805abbc8eca9412be61c295813f67bedb9f9c /coverage/control.py | |
parent | 67a7f3e65aab32763a2b3df2295c5c698ce001f0 (diff) | |
download | python-coveragepy-git-858721a9d5a3618b80d10ec71c6c2c32a89b6a7c.tar.gz |
No need for coverage.analysis to return the filename, it's a property on the CodeUnit passed in.
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 19 |
1 files changed, 10 insertions, 9 deletions
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`. |