diff options
author | Felix Horvat <felix.horvat@ocell.io> | 2022-11-17 12:34:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 03:34:22 -0800 |
commit | 26445508a2eb1c7ef459a33ec058eb3f3c5b41dd (patch) | |
tree | de2e539150ae838b813a889583e510642989c7b4 /coverage/inorout.py | |
parent | e76b5c7e0117f885f89190de9e07c1d2410ba58b (diff) | |
download | python-coveragepy-git-26445508a2eb1c7ef459a33ec058eb3f3c5b41dd.tar.gz |
feat: added support for finding unexecuted namespace packages (#1387)
* add support for namespace packages
* fixed typo
* update documentation
* fixed lint issues
* changed versionadded
* convert to config setting
* removed pure formatting changes
* code review changes
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Diffstat (limited to 'coverage/inorout.py')
-rw-r--r-- | coverage/inorout.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/coverage/inorout.py b/coverage/inorout.py index 2e534c85..0d3f6d67 100644 --- a/coverage/inorout.py +++ b/coverage/inorout.py @@ -189,9 +189,10 @@ def add_coverage_paths(paths): class InOrOut: """Machinery for determining what files to measure.""" - def __init__(self, warn, debug): + def __init__(self, warn, debug, include_namespace_packages): self.warn = warn self.debug = debug + self.include_namespace_packages = include_namespace_packages # The matchers for should_trace. self.source_match = None @@ -565,7 +566,10 @@ class InOrOut: 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)) + py_files = ( + (py_file, None) for py_file in + find_python_files(src_dir, self.include_namespace_packages) + ) plugin_files = self._find_plugin_files(src_dir) for file_path, plugin_name in itertools.chain(py_files, plugin_files): |