summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-11 15:22:18 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-11 16:15:40 -0400
commit260359756694728cd13f8c8715dddf7c6e2f371d (patch)
tree4ed1f110286dd34c53b9d1169d1d94c83bc89ac3 /doc
parentfdaa8224ccfa16233fda0c84860ef95ca073ee95 (diff)
downloadpython-coveragepy-git-260359756694728cd13f8c8715dddf7c6e2f371d.tar.gz
fix: source modules need to be re-imported. #1232
Diffstat (limited to 'doc')
-rw-r--r--doc/source.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/source.rst b/doc/source.rst
index 8debd575..bab57a72 100644
--- a/doc/source.rst
+++ b/doc/source.rst
@@ -39,6 +39,11 @@ in their names will be skipped (they are assumed to be scratch files written by
text editors). Files that do not end with ``.py``, ``.pyw``, ``.pyo``, or
``.pyc`` will also be skipped.
+.. note:: Modules named as sources may be imported twice, once by coverage.py
+ to find their location, then again by your own code or test suite. Usually
+ this isn't a problem, but could cause trouble if a module has side-effects
+ at import time.
+
You can further fine-tune coverage.py's attention with the ``--include`` and
``--omit`` switches (or ``[run] include`` and ``[run] omit`` configuration
values). ``--include`` is a list of file name patterns. If specified, only