File: other.rst

package info (click to toggle)
python-coverage 7.8.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,188 kB
  • sloc: python: 31,123; ansic: 1,184; javascript: 773; makefile: 304; sh: 107; xml: 48
file content (136 lines) | stat: -rw-r--r-- 4,219 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
.. Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
.. For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt

.. _other:

===============
Other resources
===============

There are a number of projects that help integrate coverage.py into other
systems, provide help using it, offer assistance, and so on.

There's no guarantee these items are maintained or work well.  Some of them
seem to be quite old.  If you have suggestions for updates to this page, `open
a pull request`_ or `get in touch`_ some other way.

.. _open a pull request: https://github.com/nedbat/coveragepy/blob/master/doc/other.rst
.. _get in touch: https://nedbatchelder.com/site/aboutned.html


Test runners
------------

Helpers for using coverage with specific test runners.

* `pytest-cov`__ is a pytest plugin to coordinate coverage.py usage.

  __ https://pypi.org/project/pytest-cov/

* `trialcoverage`__ is a plug-in for Twisted trial.

  __ https://pypi.org/project/trialcoverage/


Configuration helpers
---------------------

Tools to provide more control over how coverage is configured.

* `covdefaults`__ provides "sensible" default settings for coverage.

  __ https://github.com/asottile/covdefaults

* `coverage-conditional-plugin`__ lets you use conditions instead of simple "no
  cover" pragmas to control what lines are considered under different
  conditions.

  __ https://github.com/wemake-services/coverage-conditional-plugin

* `coverage-simple-excludes`__ defines new comment formats for excluding code
  based on Python versions and operating system.

  __ https://pypi.org/project/coverage-simple-excludes/


Language plugins
----------------

Coverage.py plugins to enable coverage measurement of other languages.

* `django-coverage-plugin`__ measures the coverage of Django templates.

  __ https://pypi.org/project/django-coverage-plugin/

* `Cython`__ provides a plugin for measuring Cythonized code.

  __ https://cython.readthedocs.io/en/latest/src/tutorial/profiling_tutorial.html#enabling-coverage-analysis

* `coverage-jinja-plugin`__ is an incomplete Jinja2 plugin.

  __ https://github.com/MrSenko/coverage-jinja-plugin

* `coverage-sh`__ measures code coverage of shell (sh or bash) scripts executed
  from Python with subprocess.

  __ https://github.com/lackhove/coverage-sh

* `hy-coverage`__ supports the Hy language.

  __ https://github.com/timmartin/hy-coverage

* `coverage-mako-plugin`__ measures coverage in Mako templates.
  Doesn't work yet, probably needs some changes in Mako itself.

  __ https://bitbucket-archive.softwareheritage.org/projects/ne/ned/coverage-mako-plugin.html


Reporting helpers
-----------------

Helpers for seeing the results.

* `python-coverage-comment-action`__ can publish a delta coverage report as a
  pull request comment, create a coverage badge, or a dashboard to display in
  your readme.

  __ https://github.com/py-cov-action/python-coverage-comment-action

* `diff-cover`__ reports on the coverage of lines changed in a pull request.

  __ https://pypi.org/project/diff-cover/

* `cuvner`__ offers alternate visualizations of coverage data, including ones
  for use in terminals.

  __ https://meejah.ca/projects/cuvner

* `emacs-python-coverage`__ is an experimental Emacs package to report code
  coverage output produced by Python's coverage package directly inside Emacs
  buffers.

  __ https://github.com/wbolster/emacs-python-coverage

* `python-genbadge`__ provides a set of command line utilities to generate
  badges for tools that do not provide one, including coverage badges.

  __ https://smarie.github.io/python-genbadge/


Other articles
--------------

Writings about ways to enhance your use of coverage.py.

* `How to Ditch Codecov for Python Projects`__: using GitHub Actions to manage
  coverage across versions and report on results.

  __ https://hynek.me/articles/ditch-codecov-python/

* `Making a coverage badge`__: using GitHub Actions to produce a colored badge.

  __ https://nedbatchelder.com/blog/202209/making_a_coverage_badge.html

* `Coverage goals`__: a sidecar tool for reporting on per-file coverage goals.

  __ https://nedbatchelder.com/blog/202111/coverage_goals.html