summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-03-18 06:16:02 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-03-18 06:16:02 -0400
commit1307eaa36ecfa908c13df2c3dbad0a0dc67027b4 (patch)
treef18aaaeb6d513671bd33164b8ce5f0cae6eecec1
parent82bca5a760c43fc178123d93fc8998fe20f2b92e (diff)
downloadpython-coveragepy-git-1307eaa36ecfa908c13df2c3dbad0a0dc67027b4.tar.gz
docs: clarify the --source values
On the Test & Code podcast (https://testandcode.com/148) Brian Okken explained why the old wording was confusing. I hope this makes it clearer.
-rw-r--r--coverage/cmdline.py2
-rw-r--r--doc/source.rst6
2 files changed, 5 insertions, 3 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 0be0cca1..a27e7d98 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -176,7 +176,7 @@ class Opts(object):
)
source = optparse.make_option(
'', '--source', action='store', metavar="SRC1,SRC2,...",
- help="A list of packages or directories of code to be measured.",
+ help="A list of directories or importable names of code to measure.",
)
timid = optparse.make_option(
'', '--timid', action='store_true',
diff --git a/doc/source.rst b/doc/source.rst
index 241c3d96..9ca544ab 100644
--- a/doc/source.rst
+++ b/doc/source.rst
@@ -27,8 +27,10 @@ all code, unless it is part of the Python standard library.
You can specify source to measure with the ``--source`` command-line switch, or
the ``[run] source`` configuration value. The value is a comma- or
-newline-separated list of directories or package names. If specified, only
-source inside these directories or packages will be measured. Specifying the
+newline-separated list of directories or importable names (packages or modules).
+
+If the source option is specified, only
+code those locations will be measured. Specifying the
source option also enables coverage.py to report on unexecuted files, since it
can search the source tree for files that haven't been measured at all. Only
importable files (ones at the root of the tree, or in directories with a