File: api_module.rst

package info (click to toggle)
python-coverage 7.6.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,120 kB
  • sloc: python: 30,196; ansic: 1,181; javascript: 773; makefile: 293; sh: 107; xml: 48
file content (38 lines) | stat: -rw-r--r-- 1,146 bytes parent folder | download | duplicates (3)
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
.. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt

.. _api_module:

coverage module
---------------

.. module:: coverage

The most important thing in the coverage module is the
:class:`coverage.Coverage` class, described in :ref:`api_coverage`, but there
are a few other things also.


.. data:: version_info

A tuple of five elements, similar to :data:`sys.version_info
<python:sys.version_info>`: *major*, *minor*, *micro*, *releaselevel*, and
*serial*.  All values except *releaselevel* are integers; the release level is
``'alpha'``, ``'beta'``, ``'candidate'``, or ``'final'``. Unlike
:data:`sys.version_info <python:sys.version_info>`, the elements are not
available by name.

.. data:: __version__

A string with the version of coverage.py, for example, ``"5.0b2"``.

.. autoclass:: CoverageException


Starting coverage.py automatically
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This function is used to start coverage measurement automatically when Python
starts.  See :ref:`subprocess` for details.

.. autofunction:: process_startup