Skip to content

Commit 802a919

Browse files
committed
Document the [paths] section in the config file.
1 parent 3b4fd38 commit 802a919

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Change history for Coverage.py
55
Version 3.5.1
66
-------------
77

8+
- When combining data files from parallel runs, you can now instruct coverage
9+
about which directories are equivalent on different machines. A ``[paths]``
10+
section in the configuration file lists paths that are to be considered
11+
equivalent.
12+
813
- for-else constructs are understood better, and don't cause erroneous partial
914
branch warnings. Fixes `issue 122`_.
1015

doc/cmd.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Coverage command line usage
1111
:history: 20091127T200700, changes for 3.2
1212
:history: 20100223T200600, changes for 3.3
1313
:history: 20100725T211700, updated for 3.4
14+
:history: 20110827T212500, updated for 3.5.1, combining aliases
1415

1516
.. highlight:: console
1617

@@ -139,6 +140,11 @@ data file::
139140

140141
$ coverage combine
141142

143+
If the different machines run your code from different places in their file
144+
systems, coverage won't know how to combine the data. You can tell coverage
145+
how the different locations correlate with a ``[paths]`` section in your
146+
configuration file. See :ref:`config_paths` for details.
147+
142148

143149
.. _cmd_reporting:
144150

doc/config.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Configuration files
88
:history: 20100725T211700, updated for 3.4.
99
:history: 20100824T092900, added ``precision``.
1010
:history: 20110604T184400, updated for 3.5.
11+
:history: 20110827T212700, updated for 3.5.1
1112

1213

1314
Coverage.py options can be specified in a configuration file. This makes it
@@ -103,6 +104,33 @@ measure during execution. See :ref:`source` for details.
103104
Try this if you get seemingly impossible results.
104105

105106

107+
.. _config_paths:
108+
109+
[paths]
110+
-------
111+
112+
The entries in this section are lists of file paths that should be
113+
considered equivalent when combining data from different machines::
114+
115+
[paths]
116+
source =
117+
src/
118+
/jenkins/build/*/src
119+
c:\myproj\src
120+
121+
The names of the entries are ignored, you may choose any name that
122+
you like. The value is a lists of strings. When combining data
123+
with the ``combine`` command, two file paths will be combined
124+
if they start with paths from the same list.
125+
126+
The first value must be an actual file path on the machine where
127+
the reporting will happen, so that source code can be found.
128+
The other values can be file patterns to match against the paths
129+
of collected data.
130+
131+
See :ref:`cmd_combining` for more information.
132+
133+
106134
[report]
107135
--------
108136

0 commit comments

Comments
 (0)