python-coverage.1.txt 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. =================
  2. python-coverage
  3. =================
  4. -------------------------------------------------
  5. measure code coverage of Python program execution
  6. -------------------------------------------------
  7. :Author: |author|
  8. :Date: 2016-07-12
  9. :Copyright:
  10. Copyright © 2010–2016 Ben Finney <bignose@debian.org>
  11. :Manual section: 1
  12. :Manual group: Coverage
  13. .. |command| replace:: **python-coverage**
  14. .. |license| replace::
  15. `Apache license, version 2.0
  16. <http://www.apache.org/licenses/LICENSE-2.0>`__
  17. SYNOPSIS
  18. ========
  19. | |command| `command` [ `option` ... ]
  20. | |command| **help** [ `command` ]
  21. DESCRIPTION
  22. ===========
  23. |command| executes a Python program, measures which of its statements are
  24. executed and which are not, and reports these coverage measurements.
  25. COMMAND OVERVIEW
  26. ================
  27. |command| **annotate**
  28. Annotate source files with execution information.
  29. |command| **combine**
  30. Combine a number of data files.
  31. |command| **debug**
  32. Display diagnostic information about the internals of this
  33. program.
  34. |command| **erase**
  35. Erase previously collected coverage data.
  36. |command| **help**
  37. Get help on using coverage.py.
  38. |command| **html**
  39. Create an HTML report.
  40. |command| **report**
  41. Report coverage stats on modules.
  42. |command| **run**
  43. Run a Python program and measure code execution.
  44. |command| **xml**
  45. Create an XML report of coverage results.
  46. GLOBAL OPTIONS
  47. ==============
  48. **--help**, **-h**
  49. Describe how to use Coverage, in general or a command.
  50. **--rcfile** `RCFILE`
  51. Specify configuration file `RCFILE`. Defaults to ``.coveragerc``.
  52. **--omit** `PATTERN` ...
  53. Omit files when their filename matches one of these PATTERNs.
  54. Usually needs quoting on the command line.
  55. **--include** `PATTERN` ...
  56. Include files only when their filename path matches one of these
  57. PATTERNs. Usually needs quoting on the command line.
  58. COMMAND REFERENCE
  59. =================
  60. **annotate**
  61. Options:
  62. \-d `DIR`, --directory `DIR`
  63. Write the output files to DIR.
  64. \-i, --ignore-errors
  65. Ignore errors while reading source files.
  66. **combine** `PATH` `PATH` [ ... ]
  67. Combine data from multiple coverage files `PATH`, collected with
  68. ``run -p``. The combined results are written to a single file
  69. representing the union of the data.
  70. **debug** `topic`
  71. Display information on the internals of coverage.py, for
  72. diagnosing problems.
  73. Topics are:
  74. * `data`, to show a summary of the collected data.
  75. * `sys`, to show installation information.
  76. **erase**
  77. Erase previously collected coverage data.
  78. **help** [ `command` ]
  79. Describe how to use Coverage.
  80. **html** [ `option` ... ] [ `MODULE` ... ]
  81. Create an HTML report of the coverage of each `MODULE` file. Each file
  82. gets its own page, with the source decorated to show executed,
  83. excluded, and missed lines.
  84. Options:
  85. \-d `DIR`, --directory `DIR`
  86. Write the output files to `DIR`.
  87. \--title `TITLE`
  88. Use the text string `TITLE` as the title on the HTML.
  89. \--fail-under `MIN`
  90. Exit with a status of 2 if the total coverage is less than `MIN`.
  91. \-i, --ignore-errors
  92. Ignore errors while reading source files.
  93. **report** [ `option` ... ] [ `MODULE` ... ]
  94. Report coverage statistics on each `MODULE`.
  95. Options:
  96. \--fail-under `MIN`
  97. Exit with a status of 2 if the total coverage is less than `MIN`.
  98. \-i, --ignore-errors
  99. Ignore errors while reading source files.
  100. \-m, --show-missing
  101. Show line numbers of statements in each module that weren't
  102. executed.
  103. **run** [ `options` ... ] `PROGRAMFILE` [ `program_options` ]
  104. Run a Python program `PROGRAMFILE`, measuring code execution.
  105. Options:
  106. \-a, --append
  107. Append coverage data to .coverage, otherwise it is started clean
  108. with each run.
  109. \--branch
  110. Measure branch coverage in addition to statement coverage.
  111. \--debug `DEBUGOPT`,...
  112. Debug options `DEBUGOPT`, separated by commas
  113. \-L, --pylib
  114. Measure coverage even inside the Python installed library, which
  115. isn't done by default.
  116. \-p, --parallel-mode
  117. Append the machine name, process id and random number to the
  118. ``.coverage`` data file name to simplify collecting data from many
  119. processes.
  120. \--timid
  121. Use a simpler but slower trace method. Try this if you get
  122. seemingly impossible results!
  123. \--source `SOURCE` ...
  124. A list of packages or directories of code to be measured.
  125. **xml** [ `options` ... ] [ `MODULES` ... ]
  126. Generate an XML report of coverage results on each `MODULE`.
  127. Options:
  128. \--fail-under `MIN`
  129. Exit with a status of 2 if the total coverage is less than `MIN`.
  130. \-i, --ignore-errors
  131. Ignore errors while reading source files.
  132. \-o `OUTFILE`
  133. Write the XML report to `OUTFILE`. Defaults to ``coverage.xml``.
  134. ENVIRONMENT VARIABLES
  135. =====================
  136. COVERAGE_FILE
  137. Path to the file where coverage measurements are collected to and
  138. reported from. Default: ``.coverage`` in the current working directory.
  139. COVERAGE_OPTIONS
  140. Space-separated series of command-line options to |command|. Default:
  141. empty.
  142. HISTORY
  143. =======
  144. The |command| command is a Python program which calls the ``coverage``
  145. Python library to do all the work.
  146. The library was originally developed by Gareth Rees, and is now developed
  147. by Ned Batchelder.
  148. This manual page was written to document the |command| command for
  149. Debian. This is free software: you may copy, modify and/or distribute
  150. this work under the terms of the |license| as published by the Apache
  151. Software Foundation. No warranty expressed or implied.
  152. On Debian systems, the complete text of version 2.0 of the Apache
  153. License can be found in `/usr/share/common-licenses/Apache-2.0`.
  154. .. |author| replace:: |authorname| |authoremail|
  155. .. |authorname| replace:: Ben Finney
  156. .. |authoremail| replace:: <ben+python@benfinney.id.au>
  157. ..
  158. Local variables:
  159. coding: utf-8
  160. mode: text
  161. mode: rst
  162. time-stamp-format: "%:y-%02m-%02d"
  163. time-stamp-start: "^:Date:[ ]+"
  164. time-stamp-end: "$"
  165. time-stamp-line-limit: 20
  166. End:
  167. vim: fileencoding=utf-8 filetype=rst :