Skip to content

Commit c51ac46

Browse files
committedJan 22, 2023
docs: explain how to use --debug=trace
1 parent 82c2638 commit c51ac46

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed
 

‎doc/cmd.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,7 @@ a comma-separated list of these options, or in the :ref:`config_run_debug`
10571057
section of the .coveragerc file.
10581058

10591059
The debug output goes to stderr, unless the ``COVERAGE_DEBUG_FILE`` environment
1060-
variable names a different file, which will be appended to.
1060+
variable names a different file, which will be appended to. This can be useful
1061+
because many test runners capture output, which could hide important details.
10611062
``COVERAGE_DEBUG_FILE`` accepts the special names ``stdout`` and ``stderr`` to
10621063
write to those destinations.

‎doc/faq.rst

+16
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ FAQ and other help
1111
Frequently asked questions
1212
--------------------------
1313

14+
Q: Why are some of my files not measured?
15+
.........................................
16+
17+
Coverage.py has a number of mechanisms for deciding which files to measure and
18+
which to skip. If your files aren't being measured, use the ``--debug=trace``
19+
:ref:`option <cmd_run_debug>`, also settable as ``[run] debug=trace`` in the
20+
:ref:`settings file <config_run_debug>`, or as ``COVERAGE_DEBUG=trace`` in an
21+
environment variable.
22+
23+
This will write a line for each file considered, indicating whether it is
24+
traced or not, and if not, why not. Be careful though: the output might be
25+
swallowed by your test runner. If so, a ``COVERAGE_DEBUG_FILE=/tmp/cov.out``
26+
environemnt variable can direct the output to a file insttead to ensure you see
27+
everything.
28+
29+
1430
Q: Why do unexecutable lines show up as executed?
1531
.................................................
1632

‎doc/trouble.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ bug tracker`_ directly to see if there is some mention of it.
2525
Things that don't work
2626
----------------------
2727

28-
There are a number of popular modules, packages, and libraries that prevent
29-
coverage.py from working properly:
28+
There are a few modules or functions that prevent coverage.py from working
29+
properly:
3030

3131
* `execv`_, or one of its variants. These end the current program and replace
3232
it with a new one. This doesn't save the collected coverage data, so your

0 commit comments

Comments
 (0)
Please sign in to comment.