Skip to content

Commit 1a4fe0d

Browse files
committed
Add configuration file for the test coverage tool.
Exclude the "unittest.main()" lines from coverage analysis. Also ensure the configuration file is in the travis run directory.
1 parent 24d26a3 commit 1a4fe0d

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

.coveragerc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Configuration of the coverage.py tool for reporting test coverage.
2+
3+
[report]
4+
# RE patterns for lines to be excluded from consideration.
5+
exclude_lines =
6+
## Have to re-enable the standard pragma
7+
pragma: no cover
8+
## Don't complain if tests don't hit defensive assertion code:
9+
# raise AssertionError
10+
# raise NotImplementedError
11+
12+
## Don't complain if non-runnable code isn't run:
13+
^[ ]{4}unittest.main()

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ before_install:
5959

6060
- mkdir -p ~/pkgs/
6161
- mkdir -p ${MYRUNDIR}
62+
- cp .coveragerc ${MYRUNDIR}/
6263

6364
- $NOMC || pushd ~/pkgs/
6465
- $NOMC || wget --timestamping ${MYMCREPO}/${MYMCBUNDLE}

0 commit comments

Comments
 (0)