You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin produces coverage reports. Compared to just using ``coverage run`` this plugin does some extras:
49
+
This plugin provides coverage functionality as a pytest plugin. Compared to just using ``coverage run`` this plugin does some extras:
49
50
50
-
* Subprocess support: you can fork or run stuff in a subprocess and will get covered without any fuss.
51
-
* Xdist support: you can use all of pytest-xdist's features and still get coverage.
51
+
* Automatic erasing and combination of .coverage files and default reporting.
52
+
* Support for detailed coverage contexts (add ``--cov-context=test`` to have the full test name including parametrization as the context).
53
+
* Xdist support: you can use all of pytest-xdist's features including remote interpreters and still get coverage.
52
54
* Consistent pytest behavior. If you run ``coverage run -m pytest`` you will have slightly different ``sys.path`` (CWD will be
53
55
in it, unlike when running ``pytest``).
54
56
@@ -68,11 +70,10 @@ For distributed testing support install pytest-xdist::
68
70
69
71
pip install pytest-xdist
70
72
71
-
Upgrading from ancient pytest-cov
72
-
---------------------------------
73
+
Upgrading from pytest-cov 6.3
74
+
-----------------------------
73
75
74
-
`pytest-cov 2.0` is using a new ``.pth`` file (``pytest-cov.pth``). You may want to manually remove the older
75
-
``init_cov_core.pth`` from site-packages as it's not automatically removed.
76
+
`pytest-cov 6.3` and older were using a ``.pth`` file to enable coverage measurements in subprocesses. This was removed in `pytest-cov 7` - use `coverage's patch options <https://coverage.readthedocs.io/en/latest/config.html#run-patch>`_ to enable subprocess measurements.
76
77
77
78
Uninstalling
78
79
------------
@@ -111,10 +112,6 @@ Documentation
111
112
https://pytest-cov.readthedocs.io/en/latest/
112
113
113
114
114
-
115
-
116
-
117
-
118
115
Coverage Data File
119
116
==================
120
117
@@ -132,12 +129,6 @@ For distributed testing the workers must have the pytest-cov package installed.
132
129
the plugin must be registered through setuptools for pytest to start the plugin on the
133
130
worker.
134
131
135
-
For subprocess measurement environment variables must make it from the main process to the
136
-
subprocess. The python used by the subprocess must have pytest-cov installed. The subprocess must
137
-
do normal site initialisation so that the environment variables can be detected and coverage
138
-
started. See the `subprocess support docs <https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html>`_
Copy file name to clipboardExpand all lines: docs/reporting.rst
+40-27Lines changed: 40 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@ Reporting
3
3
4
4
It is possible to generate any combination of the reports for a single test run.
5
5
6
-
The available reports are terminal (with or without missing line numbers shown), HTML, XML, JSON, Markdown (either in 'write' or 'append' mode to file), LCOV and
7
-
annotated source code.
6
+
The available reports are terminal (with or without missing line numbers shown), HTML, XML, JSON, Markdown (either in 'write' or 'append'
7
+
mode to file), LCOV and annotated source code.
8
8
9
-
The terminal report without line numbers (default)::
9
+
The default is terminal report without line numbers::
0 commit comments