summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-18 07:02:35 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-18 07:02:35 -0400
commit50a0e37ad2e7a5ec655a797f0688f616c8b1a56f (patch)
tree4bc193ea76035b5524355338fc112610746d74ed
parent6352398dcd822b761a552d9f02df6fc96ce3cbeb (diff)
downloadpython-coveragepy-git-50a0e37ad2e7a5ec655a797f0688f616c8b1a56f.tar.gz
docs: clarify how --source affects reporting commands. #1159
-rw-r--r--doc/cmd.rst7
-rw-r--r--doc/config.rst4
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/cmd.rst b/doc/cmd.rst
index 1a54043d..2ce7cc13 100644
--- a/doc/cmd.rst
+++ b/doc/cmd.rst
@@ -103,6 +103,13 @@ but before the program invocation::
$ coverage run --source=dir1,dir2 my_program.py arg1 arg2
$ coverage run --source=dir1,dir2 -m packagename.modulename arg1 arg2
+.. note::
+ Specifying ``--source`` on the ``coverage run`` command line won't affect
+ subsequent reporting commands like ``coverage xml``. Use the
+ :ref:`source <config_run_source>` setting in the configuration file to apply
+ the setting uniformly to all commands.
+
+
Coverage.py can measure multi-threaded programs by default. If you are using
more exotic concurrency, with the `multiprocessing`_, `greenlet`_, `eventlet`_,
or `gevent`_ libraries, then coverage.py will get very confused. Use the
diff --git a/doc/config.rst b/doc/config.rst
index 8d0fc7e2..e44390e5 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -203,6 +203,10 @@ file paths in the data file. This makes it easier to measure code in one (or
multiple) environments, and then report in another. See :ref:`cmd_combine`
for details.
+Note that setting ``source`` has to be done in the configuration file rather
+than the command line for this option to work, since the reporting commands
+need to know the source origin.
+
.. versionadded:: 5.0
.. _config_run_source: