Skip to content

Commit 27cf5ea

Browse files
fmoessbauerjan-kiszka
authored andcommitted
simplify and document how to measure code coverage
This patch configures Coverage.py to measure only the code coverage of kas itself. In addition, we add a note in the devguide how to create and inspect the coverage data. Signed-off-by: Felix Moessbauer <[email protected]> Signed-off-by: Jan Kiszka <[email protected]>
1 parent 2503ab3 commit 27cf5ea

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.coveragerc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[run]
2+
omit =
3+
/usr/*
4+
tests/*

docs/devguide.rst

+12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ When you need a proxy to access the internet, add::
3232
to the call.
3333

3434

35+
Measure code coverage
36+
---------------------
37+
38+
To measure the code coverage of the unit tests, the ``pytest-cov`` package is
39+
required. On Debian systems, this is provided in ``python3-pytest-cov``.
40+
Once installed, run::
41+
42+
$ python3 -m pytest --cov --cov-report html
43+
44+
The coverage in HTML format can then be found in `htmlcov`.
45+
46+
3547
Community Resources
3648
-------------------
3749

0 commit comments

Comments
 (0)