summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-09-09 11:23:48 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-09-09 11:23:48 -0400
commit3532b93a971bac212054b4e5669339303b794570 (patch)
tree3a959db0ed8b7cfa767a4e5999339770ef76cc73
parentc447cc814c0b4e08e1307e89df66a3bffa45c0c6 (diff)
downloadpython-coveragepy-git-3532b93a971bac212054b4e5669339303b794570.tar.gz
Correct some function names and docstrings. #843
-rw-r--r--coverage/control.py5
-rw-r--r--coverage/inorout.py19
2 files changed, 14 insertions, 10 deletions
diff --git a/coverage/control.py b/coverage/control.py
index c342eca4..6830afba 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -665,9 +665,10 @@ class Coverage(object):
if not self._data and self._warn_no_data:
self._warn("No data was collected.", slug="no-data-collected")
- # Find files that were never executed at all.
+ # Touch all the files that could have executed, so that we can
+ # mark completely unexecuted files as 0% covered.
if self._data:
- for file_path, plugin_name in self._inorout.find_unexecuted_files():
+ for file_path, plugin_name in self._inorout.find_possibly_unexecuted_files():
self._data.touch_file(file_path, plugin_name)
if self.config.note:
diff --git a/coverage/inorout.py b/coverage/inorout.py
index c31e9206..2a19ba69 100644
--- a/coverage/inorout.py
+++ b/coverage/inorout.py
@@ -395,8 +395,8 @@ class InOrOut(object):
slug="module-not-measured",
)
- def find_unexecuted_files(self):
- """Find files in the areas of interest that weren't traced.
+ def find_possibly_unexecuted_files(self):
+ """Find files in the areas of interest that might be untraced.
Yields pairs: file path, and responsible plug-in name.
"""
@@ -405,11 +405,11 @@ class InOrOut(object):
not module_has_file(sys.modules[pkg])):
continue
pkg_file = source_for_file(sys.modules[pkg].__file__)
- for ret in self._find_unexecuted_files(canonical_path(pkg_file)):
+ for ret in self._find_executable_files(canonical_path(pkg_file)):
yield ret
for src in self.source:
- for ret in self._find_unexecuted_files(src):
+ for ret in self._find_executable_files(src):
yield ret
def _find_plugin_files(self, src_dir):
@@ -418,11 +418,14 @@ class InOrOut(object):
for x_file in plugin.find_executable_files(src_dir):
yield x_file, plugin._coverage_plugin_name
- def _find_unexecuted_files(self, src_dir):
- """Find unexecuted files in `src_dir`.
+ def _find_executable_files(self, src_dir):
+ """Find executable files in `src_dir`.
- Search for files in `src_dir` that are probably importable,
- and add them as unexecuted files in `self.data`.
+ Search for files in `src_dir` that can be executed because they
+ are probably importable. Don't include ones that have been omitted
+ by the configuration.
+
+ Yield the file path, and the plugin name that handles the file.
"""
py_files = ((py_file, None) for py_file in find_python_files(src_dir))