summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/config.rst79
1 files changed, 68 insertions, 11 deletions
diff --git a/doc/config.rst b/doc/config.rst
index 43d5a27e..e332f50a 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -7,17 +7,6 @@
Configuration reference
=======================
-.. :history: 20100223T201600, new for 3.3
-.. :history: 20100725T211700, updated for 3.4.
-.. :history: 20100824T092900, added ``precision``.
-.. :history: 20110604T184400, updated for 3.5.
-.. :history: 20110827T212700, updated for 3.5.1
-.. :history: 20130926T222300, updated for 3.6.1
-.. :history: 20140925T064700, updated for 4.0a1
-.. :history: 20150124T173400, updated for 4.0a4
-.. :history: 20150802T174600, updated for 4.0b1
-
-
Coverage.py options can be specified in a configuration file. This makes it
easier to re-run coverage.py with consistent settings, and also allows for
specification of options that are otherwise only available in the
@@ -111,9 +100,13 @@ Here's a sample configuration file::
These values are generally used when running product code, though some apply
to more than one command.
+.. _config_run_branch:
+
``branch`` (boolean, default False): whether to measure
:ref:`branch coverage <branch>` in addition to statement coverage.
+.. _config_run_command_line:
+
``command_line`` (string): the command-line to run your program. This will be
used if you run ``coverage run`` with no further arguments. Coverage.py
options cannot be specified here, other than ``-m`` to indicate the module to
@@ -121,6 +114,8 @@ run.
.. versionadded:: 5.0
+.. _config_run_concurrency:
+
``concurrency`` (multi-string, default "thread"): the name concurrency
libraries in use by the product code. If your program uses `multiprocessing`_,
`gevent`_, `greenlet`_, or `eventlet`_, you must name that library in this
@@ -135,14 +130,20 @@ Before version 4.2, this option only accepted a single string.
.. versionadded:: 4.0
+.. _config_run_context:
+
``context`` (string): the static context to record for this coverage run. See
:ref:`contexts` for more information
.. versionadded:: 5.0
+.. _config_run_cover_pylib:
+
``cover_pylib`` (boolean, default False): whether to measure the Python
standard library.
+.. _config_run_data_file:
+
``data_file`` (string, default ".coverage"): the name of the data file to use
for storing or reporting coverage. This value can include a path to another
directory.
@@ -153,31 +154,47 @@ directory.
that can be disabled include a short string at the end, the name of the
warning. See :ref:`cmd_warnings` for specific warnings.
+.. _config_run_debug:
+
``debug`` (multi-string): a list of debug options. See :ref:`the run
--debug option <cmd_run_debug>` for details.
+.. _config_run_include:
+
``include`` (multi-string): a list of file name patterns, the files to include
in measurement or reporting. Ignored if ``source`` is set. See :ref:`source`
for details.
+.. _config_run_note:
+
``note`` (string): an arbitrary string that will be written to the data file.
You can use the :meth:`.CoverageData.run_infos` method to retrieve this string
from a data file.
+.. _config_run_omit:
+
``omit`` (multi-string): a list of file name patterns, the files to leave out
of measurement or reporting. See :ref:`source` for details.
+.. _config_run_parallel:
+
``parallel`` (boolean, default False): append the machine name, process
id and random number to the data file name to simplify collecting data from
many processes. See :ref:`cmd_combining` for more information.
+.. _config_run_plugins:
+
``plugins`` (multi-string): a list of plugin package names. See :ref:`plugins`
for more information.
+.. _config_run_source:
+
``source`` (multi-string): a list of packages or directories, the source to
measure during execution. If set, ``include`` is ignored. See :ref:`source`
for details.
+.. _config_run_timid:
+
``timid`` (boolean, default False): use a simpler but slower trace method.
This uses PyTracer instead of CTracer, and is only needed in very unusual
circumstances. Try this if you get seemingly impossible results.
@@ -221,44 +238,64 @@ See :ref:`cmd_combining` for more information.
Values common to many kinds of reporting.
+.. _config_report_exclude_lines:
+
``exclude_lines`` (multi-string): a list of regular expressions. Any line of
your source code that matches one of these regexes is excluded from being
reported as missing. More details are in :ref:`excluding`. If you use this
option, you are replacing all the exclude regexes, so you'll need to also
supply the "pragma: no cover" regex if you still want to use it.
+.. _config_report_fail_under:
+
``fail_under`` (float): a target coverage percentage. If the total coverage
measurement is under this value, then exit with a status code of 2. If you
specify a non-integral value, you must also set ``[report] precision`` properly
to make use of the decimal places. A setting of 100 will fail any value under
100, regardless of the number of decimal places of precision.
+.. _config_report_ignore_errors:
+
``ignore_errors`` (boolean, default False): ignore source code that can't be
found, emitting a warning instead of an exception.
+.. _config_report_include:
+
``include`` (multi-string): a list of file name patterns, the files to include
in reporting. See :ref:`source` for details.
+.. _config_report_omit:
+
``omit`` (multi-string): a list of file name patterns, the files to leave out
of reporting. See :ref:`source` for details.
+.. _config_report_partial_branches:
+
``partial_branches`` (multi-string): a list of regular expressions. Any line
of code that matches one of these regexes is excused from being reported as
a partial branch. More details are in :ref:`branch`. If you use this option,
you are replacing all the partial branch regexes so you'll need to also
supply the "pragma: no branch" regex if you still want to use it.
+.. _config_report_precision:
+
``precision`` (integer): the number of digits after the decimal point to
display for reported coverage percentages. The default is 0, displaying for
example "87%". A value of 2 will display percentages like "87.32%". This
setting also affects the interpretation of the ``fail_under`` setting.
+.. _config_report_show_missing:
+
``show_missing`` (boolean, default False): when running a summary report, show
missing lines. See :ref:`cmd_summary` for more information.
+.. _config_report_skip_covered:
+
``skip_covered`` (boolean, default False): Don't include files in the report
that are 100% covered files. See :ref:`cmd_summary` for more information.
+.. _config_report_sort:
+
``sort`` (string, default "Name"): Sort the text report by the named column.
Allowed values are "Name", "Stmts", "Miss", "Branch", "BrPart", or "Cover".
@@ -271,18 +308,26 @@ Allowed values are "Name", "Stmts", "Miss", "Branch", "BrPart", or "Cover".
Values particular to HTML reporting. The values in the ``[report]`` section
also apply to HTML output, where appropriate.
+.. _config_html_directory:
+
``directory`` (string, default "htmlcov"): where to write the HTML report
files.
+.. _config_html_show_context:
+
``show_contexts`` (boolean): should the HTML report include an indication on
each line of which contexts executed the line. See :ref:`dynamic_contexts` for
details.
+.. _config_html_extra_css:
+
``extra_css`` (string): the path to a file of CSS to apply to the HTML report.
The file will be copied into the HTML output directory. Don't name it
"style.css". This CSS is in addition to the CSS normally used, though you can
overwrite as many of the rules as you like.
+.. _config_html_title:
+
``title`` (string, default "Coverage report"): the title to use for the report.
Note this is text, not HTML.
@@ -295,8 +340,12 @@ Note this is text, not HTML.
Values particular to XML reporting. The values in the ``[report]`` section
also apply to XML output, where appropriate.
+.. _config_xml_output:
+
``output`` (string, default "coverage.xml"): where to write the XML report.
+.. _config_xml_package_depth:
+
``package_depth`` (integer, default 99): controls which directories are
identified as packages in the report. Directories deeper than this depth are
not reported as packages. The default is that all directories are reported as
@@ -311,12 +360,20 @@ packages.
Values particular to JSON reporting. The values in the ``[report]`` section
also apply to JSON output, where appropriate.
+.. versionadded:: 5.0
+
+.. _config_json_output:
+
``output`` (string, default "coverage.json"): where to write the JSON file.
+.. _config_json_pretty_print:
+
``pretty_print`` (boolean, default false): controls if the JSON is outputted
with whitespace formatted for human consumption (True) or for minimum file size
(False).
+.. _config_json_show_contexts:
+
``show_contexts`` (boolean, default false): should the JSON report include an
indication of which contexts executed each line. See :ref:`dynamic_contexts`
for details.