diff options
author | Buck Golemon <buck@yelp.com> | 2014-11-14 17:52:52 -0800 |
---|---|---|
committer | Buck Golemon <buck@yelp.com> | 2014-11-14 17:52:52 -0800 |
commit | 5082e667fbc65db03d32138fcdfa087a6fc073a6 (patch) | |
tree | 17229105b774912609a6e15fa3e02d2bff044a47 | |
parent | ae3deed9e39b528abc2259a2fe7f7178623fce8e (diff) | |
download | python-coveragepy-git-5082e667fbc65db03d32138fcdfa087a6fc073a6.tar.gz |
ned code review, part 1
--HG--
branch : __main__-support
-rw-r--r-- | coverage/control.py | 9 | ||||
-rw-r--r-- | coverage/files.py | 3 |
2 files changed, 5 insertions, 7 deletions
diff --git a/coverage/control.py b/coverage/control.py index 1b932da3..6a136da4 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -199,7 +199,6 @@ class Coverage(object): self.source.append(self.file_locator.canonical_filename(src)) else: self.source_pkgs.append(src) - self.not_imported = list(self.source_pkgs) self.omit = prep_patterns(self.config.omit) self.include = prep_patterns(self.config.include) @@ -432,8 +431,8 @@ class Coverage(object): # stdlib and coverage.py directories. if self.source_match: if self.source_pkgs_match.match(modulename): - if modulename in self.not_imported: - self.not_imported.remove(modulename) + if modulename in self.source_pkgs: + self.source_pkgs.remove(modulename) return None # There's no reason to skip this file. if not self.source_match.match(filename): @@ -655,10 +654,10 @@ class Coverage(object): self.data.add_plugin_data(self.collector.get_plugin_data()) self.collector.reset() - # If there are still entries in the not_imported list, then we never + # If there are still entries in the source_pkgs list, then we never # encountered those packages. if self._warn_unimported_source: - for pkg in self.not_imported: + for pkg in self.source_pkgs: if pkg not in sys.modules: self._warn("Module %s was never imported." % pkg) elif not ( diff --git a/coverage/files.py b/coverage/files.py index 97888b62..332c4225 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -174,10 +174,9 @@ class TreeMatcher(object): class ModuleMatcher(object): - """A matcher for files in a tree.""" + """A matcher for modules in a tree.""" def __init__(self, module_names): self.modules = list(module_names) - self.not_imported = list(module_names) def __repr__(self): return "<ModuleMatcher %r>" % (self.modules) |