@@ -8,14 +8,16 @@ Measure Python code coverage
8
8
9
9
:Author: Ned Batchelder <
[email protected] >
10
10
:Author: |author |
11
- :Date: 2022-12-03
11
+ :Date: 2025-07-24
12
12
:Copyright: Apache 2.0 license, attribution and disclaimer required.
13
13
:Manual section: 1
14
14
:Manual group: Coverage.py
15
15
16
16
.. |command | replace :: **python-coverage **
17
17
18
18
..
19
+ This file is .rst format to produce a man page source file.
20
+
19
21
To test this file:
20
22
$ rst2man < doc/python-coverage.1.txt | groff -man -Tascii
21
23
@@ -78,8 +80,8 @@ GLOBAL OPTIONS
78
80
Describe how to use coverage.py, in general or a command.
79
81
80
82
**--rcfile ** `RCFILE `
81
- Specify configuration file `RCFILE `. By default ' .coveragerc' ,
82
- ' setup.cfg', ' tox.ini' , and ' pyproject.toml' are tried.
83
+ Specify configuration file `RCFILE `. By default `` .coveragerc `` ,
84
+ `` setup.cfg ``, `` tox.ini `` , and `` pyproject.toml `` are tried.
83
85
84
86
**--debug ** `DEBUGOPT `,...
85
87
Debug options `DEBUGOPT `, separated by commas.
@@ -89,7 +91,10 @@ GLOBAL OPTIONS
89
91
COMMAND REFERENCE
90
92
=================
91
93
92
- **annotate ** [ `option ` ... ]
94
+ **annotate ** [ `option ` ... ] [ `MODULE ` ... ]
95
+
96
+ Make annotated copies of the given files, marking statements that are
97
+ executed and statements that are missed.
93
98
94
99
Options:
95
100
@@ -98,7 +103,7 @@ COMMAND REFERENCE
98
103
99
104
\- -data-file `INFILE `
100
105
Read coverage data for report generation from this
101
- file. Defaults to ' .coverage' .
106
+ file. Defaults to `` .coverage `` .
102
107
103
108
\- i, --ignore-errors
104
109
Ignore errors while reading source files.
@@ -111,6 +116,7 @@ COMMAND REFERENCE
111
116
Omit files when their file name matches one of these PATTERNs.
112
117
Usually needs quoting on the command line.
113
118
119
+
114
120
**combine ** [ `option ` ... ] [ `PATH ` ... ]
115
121
116
122
Combine data from multiple coverage files collected with ``run -p ``.
@@ -128,15 +134,16 @@ COMMAND REFERENCE
128
134
time.
129
135
130
136
\- -data-file `DATAFILE `
131
- Base name of the data files to operate on. Defaults to ' .coverage' .
137
+ Base name of the data files to operate on. Defaults to `` .coverage `` .
132
138
133
139
\- -keep
134
140
Keep original coverage data files.
135
141
136
142
\- q, --quiet
137
143
Don't print messages about what is happening.
138
144
139
- **debug ** `TOPIC ` ...
145
+
146
+ **debug ** `TOPIC `
140
147
141
148
Display information about the internals of coverage.py, for diagnosing
142
149
problems.
@@ -149,19 +156,22 @@ COMMAND REFERENCE
149
156
``premain `` to show what is calling coverage;
150
157
``pybehave `` to show internal flags describing Python behavior.
151
158
159
+
152
160
**erase **
153
161
154
162
Erase previously collected coverage data.
155
163
156
164
Options:
157
165
158
166
\- -data-file `DATAFILE `
159
- Base name of the data files to operate on. Defaults to '.coverage'.
167
+ Base name of the data files to operate on. Defaults to ``.coverage ``.
168
+
160
169
161
170
**help ** [ `command ` ]
162
171
163
172
Describe how to use coverage.py.
164
173
174
+
165
175
**html ** [ `option ` ... ] [ `MODULE ` ... ]
166
176
167
177
Create an HTML report of the coverage of each `MODULE ` file. Each file
@@ -178,7 +188,7 @@ COMMAND REFERENCE
178
188
179
189
\- -data-file `INFILE `
180
190
Read coverage data for report generation from this file.
181
- Defaults to ' .coverage' .
191
+ Defaults to `` .coverage `` .
182
192
183
193
\- -fail-under `MIN `
184
194
Exit with a status of 2 if the total coverage is less than `MIN `.
@@ -216,6 +226,7 @@ COMMAND REFERENCE
216
226
\- -title `TITLE `
217
227
Use the text string `TITLE ` as the title on the HTML.
218
228
229
+
219
230
**json ** [ `option ` ... ] [ `MODULE ` ... ]
220
231
221
232
Generate a JSON report of coverage results.
@@ -225,7 +236,7 @@ COMMAND REFERENCE
225
236
226
237
\- -data-file `INFILE `
227
238
Read coverage data for report generation from this file.
228
- Defaults to ' .coverage' .
239
+ Defaults to `` .coverage `` .
229
240
230
241
\- -fail-under `MIN `
231
242
Exit with a status of 2 if the total coverage is less than `MIN `.
@@ -253,6 +264,7 @@ COMMAND REFERENCE
253
264
\- -show-contexts
254
265
Include information about the contexts that executed each line.
255
266
267
+
256
268
**lcov ** [ `option ` ... ] [ `MODULE ` ... ]
257
269
258
270
Create an LCOV report of the coverage results.
@@ -261,7 +273,7 @@ COMMAND REFERENCE
261
273
262
274
\- -data-file `INFILE `
263
275
Read coverage data for report generation from this file.
264
- Defaults to ' .coverage' .
276
+ Defaults to `` .coverage `` .
265
277
266
278
\- -fail-under `MIN `
267
279
Exit with a status of 2 if the total coverage is less than `MIN `.
@@ -283,6 +295,7 @@ COMMAND REFERENCE
283
295
\- q, --quiet
284
296
Don't print messages about what is happening.
285
297
298
+
286
299
**report ** [ `option ` ... ] [ `MODULE ` ... ]
287
300
288
301
Report coverage statistics on each `MODULE `.
@@ -294,13 +307,13 @@ COMMAND REFERENCE
294
307
295
308
\- -data-file `INFILE `
296
309
Read coverage data for report generation from this file.
297
- Defaults to ' .coverage' .
310
+ Defaults to `` .coverage `` .
298
311
299
312
\- -fail-under `MIN `
300
313
Exit with a status of 2 if the total coverage is less than `MIN `.
301
314
302
315
\- -format `FORMAT `
303
- Output format, either text (default), markdown, or total.
316
+ Output format, either `` text `` (default), `` markdown `` , or `` total `` .
304
317
305
318
\- i, --ignore-errors
306
319
Ignore errors while reading source files.
@@ -331,8 +344,8 @@ COMMAND REFERENCE
331
344
Skip files with no code.
332
345
333
346
\- -sort `COLUMN `
334
- Sort the report by thee named column: `name `, `stmts `, `miss `,
335
- `branch `, `brpart `, or `cover `.
347
+ Sort the report by the named column: `` name `` , `` stmts `` , `` miss ` `,
348
+ `` branch `` , `` brpart `` , or `` cover ` `.
336
349
337
350
338
351
**run ** [ `options ` ... ] `PROGRAMFILE ` [ `program_options ` ]
@@ -350,15 +363,15 @@ COMMAND REFERENCE
350
363
351
364
\- -concurrency `LIBS `
352
365
Properly measure code using a concurrency library. Valid values are:
353
- thread, gevent, greenlet, eventlet, multiprocessing, or a comma-list of
354
- them.
366
+ `` thread ``, `` gevent ``, `` greenlet ``, `` eventlet ``,
367
+ `` multiprocessing ``, or a comma-list of them.
355
368
356
369
\- -context `CONTEXT `
357
370
The context label to record for this coverage run.
358
371
359
372
\- -data-file `OUTFILE `
360
373
Write the recorded coverage data to this file.
361
- Defaults to ' .coverage' .
374
+ Defaults to `` .coverage `` .
362
375
363
376
\- -include `PATTERN ` [ , ... ]
364
377
Include only files whose paths match one of these
@@ -380,12 +393,17 @@ COMMAND REFERENCE
380
393
``.coverage `` data file name to simplify collecting data from many
381
394
processes.
382
395
396
+ \- -save-signal `SIGNAL `
397
+ Specify a signal that will trigger coverage to write its collected
398
+ data. Supported values are: ``USR1 ``, ``USR2 ``.
399
+
383
400
\- -source `SOURCE ` ...
384
401
A list of packages or directories of code to be measured.
385
402
386
403
\- -timid
387
404
Use the slower Python trace function core.
388
405
406
+
389
407
**xml ** [ `options ` ... ] [ `MODULES ` ... ]
390
408
391
409
Generate an XML report of coverage results on each `MODULE `.
@@ -394,7 +412,7 @@ COMMAND REFERENCE
394
412
395
413
\- -data-file `INFILE `
396
414
Read coverage data for report generation from this file.
397
- Defaults to ' .coverage' .
415
+ Defaults to `` .coverage `` .
398
416
399
417
\- -fail-under `MIN `
400
418
Exit with a status of 2 if the total coverage is less than `MIN `.
@@ -423,6 +441,14 @@ COMMAND REFERENCE
423
441
ENVIRONMENT VARIABLES
424
442
=====================
425
443
444
+ COVERAGE_DEBUG
445
+
446
+ Debug options, same as for the ``--debug `` option.
447
+
448
+ COVERAGE_DEBUG_FILE
449
+
450
+ Where to write debug information, defaulting to stderr.
451
+
426
452
COVERAGE_FILE
427
453
428
454
Path to the file where coverage measurements are collected to and
@@ -432,6 +458,7 @@ COVERAGE_RCFILE
432
458
433
459
Path to the configuration file, often named ``.coveragerc ``.
434
460
461
+
435
462
HISTORY
436
463
=======
437
464
0 commit comments