summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-04-04 07:08:41 -0400
committerNed Batchelder <ned@nedbatchelder.com>2017-04-04 07:08:41 -0400
commita0d7920455a7844fecd97180256c9d6242fb5a14 (patch)
tree1a84f8e2c315015d5519c2e5d7e3058930265588 /doc
parent2f01ede8dd7eeb8f59db533921afd6ff56ff6acb (diff)
downloadpython-coveragepy-a0d7920455a7844fecd97180256c9d6242fb5a14.tar.gz
Warnings can be disabled
Diffstat (limited to 'doc')
-rw-r--r--doc/cmd.rst25
-rw-r--r--doc/config.rst6
2 files changed, 25 insertions, 6 deletions
diff --git a/doc/cmd.rst b/doc/cmd.rst
index acc56d5..e9d5100 100644
--- a/doc/cmd.rst
+++ b/doc/cmd.rst
@@ -131,40 +131,53 @@ If you are measuring coverage in a multi-process program, or across a number of
machines, you'll want the ``--parallel-mode`` switch to keep the data separate
during measurement. See :ref:`cmd_combining` below.
+
+.. _cmd_warnings:
+
+Warnings
+--------
+
During execution, coverage.py may warn you about conditions it detects that
could affect the measurement process. The possible warnings include:
-* "Trace function changed, measurement is likely wrong: XXX"
+* "Trace function changed, measurement is likely wrong: XXX (trace-changed)"
Coverage measurement depends on a Python setting called the trace function.
Other Python code in your product might change that function, which will
- disrupt coverage.py's measurement. This warning indicate that has happened.
+ disrupt coverage.py's measurement. This warning indicates that has happened.
The XXX in the message is the new trace function value, which might provide
a clue to the cause.
-* "Module XXX has no Python source"
+* "Module XXX has no Python source (module-not-python)"
You asked coverage.py to measure module XXX, but once it was imported, it
turned out not to have a corresponding .py file. Without a .py file,
coverage.py can't report on missing lines.
-* "Module XXX was never imported"
+* "Module XXX was never imported (module-not-imported)"
You asked coverage.py to measure module XXX, but it was never imported by
your program.
-* "No data was collected"
+* "No data was collected (no-data-collected)"
Coverage.py ran your program, but didn't measure any lines as executed.
This could be because you asked to measure only modules that never ran,
or for other reasons.
-* "Module XXX was previously imported, but not measured."
+* "Module XXX was previously imported, but not measured. (module-not-measured)"
You asked coverage.py to measure module XXX, but it had already been imported
when coverage started. This meant coverage.py couldn't monitor its
execution.
+Individual warnings can be disabled with the `disable_warnings
+<config_run_disable_warnings>`_ configuration setting. To silence "No data was
+collected," add this to your .coveragerc file::
+
+ [run]
+ disable_warnings = no-data-collected
+
.. _cmd_datafile:
diff --git a/doc/config.rst b/doc/config.rst
index 89493ec..0740ef1 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -126,6 +126,12 @@ Before version 4.2, this option only accepted a single string.
for storing or reporting coverage. This value can include a path to another
directory.
+.. _config_run_disable_warnings:
+
+``disable_warnings`` (multi-string): a list of warnings to disable. Warnings
+that can be disabled include a short string at the end, the name of the
+warning. See :ref:`cmd_warnings` for specific warnings.
+
``debug`` (multi-string): a list of debug options. See :ref:`the run
--debug option <cmd_run_debug>` for details.