File: python-coverage.1.txt

package info (click to toggle)
python-coverage 6.5.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,580 kB
  • sloc: python: 25,471; ansic: 1,152; javascript: 1,104; makefile: 253; sh: 107; xml: 48
file content (253 lines) | stat: -rw-r--r-- 6,350 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
=================
python-coverage
=================

-------------------------------------------------
measure code coverage of Python program execution
-------------------------------------------------

:Author: |author|
:Date: 2020-09-06
:Copyright:
    Copyright © 2010–2017 Ben Finney <bignose@debian.org>
:Manual section: 1
:Manual group: Coverage

..  |command| replace:: **python-coverage**
..  |license| replace::
    `GNU General Public License, version 3 or later
    <http://www.gnu.org/licenses/>`__


SYNOPSIS
========

| |command| `command` [ `option` ... ]
| |command| **help** [ `command` ]


DESCRIPTION
===========

|command| executes a Python program, measures which of its statements are
executed and which are not, and reports these coverage measurements.


COMMAND OVERVIEW
================

|command| **annotate**
    Annotate source files with execution information.

|command| **combine**
    Combine a number of data files.

|command| **debug**
    Display diagnostic information about the internals of this
    program.

|command| **erase**
    Erase previously collected coverage data.

|command| **help**
    Get help on using coverage.py.

|command| **html**
    Create an HTML report.

|command| **report**
    Report coverage stats on modules.

|command| **run**
    Run a Python program and measure code execution.

|command| **xml**
    Create an XML report of coverage results.


GLOBAL OPTIONS
==============

**--help**, **-h**
    Describe how to use Coverage, in general or a command.

**--rcfile** `RCFILE`
    Specify configuration file `RCFILE`. Defaults to ``.coveragerc``.

**--omit** `PATTERN` ...
    Omit files when their filename matches one of these PATTERNs.
    Usually needs quoting on the command line.

**--include** `PATTERN` ...
    Include files only when their filename path matches one of these
    PATTERNs. Usually needs quoting on the command line.


COMMAND REFERENCE
=================

**annotate**

    Options:

    \-d `DIR`, --directory `DIR`
        Write the output files to DIR.

    \-i, --ignore-errors
        Ignore errors while reading source files.

**combine** `PATH` `PATH` [ ... ]

    Combine data from multiple coverage files `PATH`, collected with
    ``run -p``. The combined results are written to a single file
    representing the union of the data.

**debug** `topic`

    Display information on the internals of coverage.py, for
    diagnosing problems.

    Topics are:

    * `data`, to show a summary of the collected data.
    * `sys`, to show installation information.

**erase**

    Erase previously collected coverage data.

**help** [ `command` ]

    Describe how to use Coverage.

**html** [ `option` ... ] [ `MODULE` ... ]

    Create an HTML report of the coverage of each `MODULE` file. Each file
    gets its own page, with the source decorated to show executed,
    excluded, and missed lines.

    Options:

    \-d `DIR`, --directory `DIR`
        Write the output files to `DIR`.

    \--title `TITLE`
        Use the text string `TITLE` as the title on the HTML.

    \--fail-under `MIN`
        Exit with a status of 2 if the total coverage is less than `MIN`.

    \-i, --ignore-errors
        Ignore errors while reading source files.

**report** [ `option` ... ] [ `MODULE` ... ]

    Report coverage statistics on each `MODULE`.

    Options:

    \--fail-under `MIN`
        Exit with a status of 2 if the total coverage is less than `MIN`.

    \-i, --ignore-errors
        Ignore errors while reading source files.

    \-m, --show-missing
        Show line numbers of statements in each module that weren't
        executed.

**run** [ `options` ... ] `PROGRAMFILE` [ `program_options` ]

    Run a Python program `PROGRAMFILE`, measuring code execution.

    Options:

    \-a, --append
        Append coverage data to .coverage, otherwise it is started clean
        with each run.

    \--branch
        Measure branch coverage in addition to statement coverage.

    \--debug `DEBUGOPT`,...
        Debug options `DEBUGOPT`, separated by commas

    \-L, --pylib
        Measure coverage even inside the Python installed library, which
        isn't done by default.

    \-p, --parallel-mode
        Append the machine name, process id and random number to the
        ``.coverage`` data file name to simplify collecting data from many
        processes.

    \--timid
        Use a simpler but slower trace method. Try this if you get
        seemingly impossible results!

    \--source `SOURCE` ...
        A list of packages or directories of code to be measured.

**xml** [ `options` ... ] [ `MODULES` ... ]

    Generate an XML report of coverage results on each `MODULE`.

    Options:

    \--fail-under `MIN`
        Exit with a status of 2 if the total coverage is less than `MIN`.

    \-i, --ignore-errors
        Ignore errors while reading source files.

    \-o `OUTFILE`
        Write the XML report to `OUTFILE`. Defaults to ``coverage.xml``.


ENVIRONMENT VARIABLES
=====================

COVERAGE_FILE

    Path to the file where coverage measurements are collected to and
    reported from. Default: ``.coverage`` in the current working directory.

COVERAGE_OPTIONS

    Space-separated series of command-line options to |command|. Default:
    empty.


HISTORY
=======

The |command| command is a Python program which calls the ``coverage`` Python
library to do all the work.

The library was originally developed by Gareth Rees, and is now developed by
Ned Batchelder.

This manual page was written to document the |command| command for Debian. This
is free software: you may copy, modify and/or distribute this work under the
terms of the |license| as published by the Free Software Foundation, version 3
or later. No warranty expressed or implied.

On Debian systems, the complete text of the GNU General Public License version
3 can be found in the file `/usr/share/common-licenses/GPL-3`.

..  |author| replace:: |authorname| |authoremail|
..  |authorname| replace:: Ben Finney
..  |authoremail| replace:: <ben+python@benfinney.id.au>


..
    Local variables:
    coding: utf-8
    mode: text
    mode: rst
    time-stamp-format: "%:y-%02m-%02d"
    time-stamp-start: "^:Date:[         ]+"
    time-stamp-end: "$"
    time-stamp-line-limit: 20
    End:
    vim: fileencoding=utf-8 filetype=rst :