Skip to content

Commit 9b8ef51

Browse files
committed
Add coverage statistics to unittest runs
Signed-off-by: Matthew Johnson <[email protected]>
1 parent 52a48c0 commit 9b8ef51

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ __pycache__
33
*~
44
*.swp
55
tags
6+
.coverage
7+
htmlcov

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ language: python
22
sudo: enabled
33
python:
44
- "3.6"
5+
6+
install:
7+
- pip install -r requirements.txt
8+
59
# command to run tests
610
script:
711
- make check

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ test_autospec:
4747
python3 tests/test_autospec.py -c ${CASES}
4848

4949
unittests:
50-
PYTHONPATH=${CURDIR}/autospec python3 -m unittest discover -b -s tests -p 'test_*.py'
50+
PYTHONPATH=${CURDIR}/autospec coverage run -m unittest discover -b -s tests -p 'test_*.py' && coverage report
51+
52+
coverage:
53+
coverage report -m

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ flake8>=3.4.0
22
pycurl>=7.43.0
33
toml>=0.9.0
44
mock>=2.0.0
5+
coverage>=4.4.1

setup.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
tag_build =
33
[pycodestyle]
44
ignore = E501
5+
6+
[coverage:run]
7+
# omit tests and travis site-packages
8+
omit = tests/*,*site-packages*,*site.py

0 commit comments

Comments
 (0)