Skip to content

Commit 453c7b0

Browse files
authored
Improved coverage config and enabled branch coverage (#2074)
Details: * Removed Python standard packages from coverage report in local test runs by specifying run.source in .coveragerc. * Fixed the run.omit directories to use /** instead of /*. That did not change anything but it is now following the documentation for matching subtrees. * Enabled branch coverage reporting. This lowered the total reported coverage somewhat. * Specified coverage precision to be 2. That is the default on coveralls.io, but for local runs it overwrites the default of 0. Signed-off-by: Andreas Maier <maiera@de.ibm.com>
1 parent 030803c commit 453c7b0

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

.coveragerc

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,27 @@
55

66
[run]
77

8+
# Directories to include in the coverage.
9+
source_dirs =
10+
zhmcclient/
11+
zhmcclient_mock/
12+
13+
# Files and directories to exclude in the coverage.
14+
# For coveralls.io, tests/ also needs to be excluded even though it is not
15+
# in source_dirs.
16+
omit =
17+
zhmcclient/_vendor/*
18+
tests/*
19+
820
# Controls whether branch coverage is measured, vs. just statement coverage.
9-
# TODO: Once statement coverage gets better, enable branch coverage.
10-
branch = False
21+
# This only affects locally created coverage. coveralls.io ignores this
22+
# and has its own setting for branch coverage.
23+
branch = True
1124

1225
# If True, stores relative file paths in data file (needed for Github Actions).
1326
# Using this parameter requires coverage>=5.0
1427
relative_files = True
1528

16-
# The following files are omitted in the coverage.
17-
omit =
18-
zhmcclient/_vendor/*
19-
tests/*
20-
2129
# Enable to see which for which source files coverage is traced.
2230
# debug = trace
2331

@@ -26,6 +34,10 @@ omit =
2634
# Controls whether lines without coverage are shown in the report.
2735
show_missing = True
2836

37+
# Number of digits after the decimal point for coverage percentages.
38+
precision = 2
39+
2940
[html]
3041

42+
# Output directory for the HTML report
3143
directory = htmlcov

0 commit comments

Comments
 (0)