Skip to content

Commit a4291d1

Browse files
authored
Merge pull request #4605 from stsewd/run-coverage
Run coverage on travis
2 parents c764af6 + 326d621 commit a4291d1

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

.codecov.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
comment:
2+
layout: "diff, files"

.coveragerc

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
[run]
2+
branch = true
3+
source = .
24
omit =
35
*/**/migrations/*
6+
*/**/management/commands/*
7+
*/**/settings/*
8+
*/**/settings.py
9+
analytics/vendor/*
10+
rtd_tests/*
11+
*/**/tests/**
12+
wsgi.py
13+
14+
[report]
15+
exclude_lines =
16+
if self.debug:
17+
pragma: no cover
18+
raise NotImplementedError
19+
if __name__ == .__main__.:

requirements/testing.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pytest==3.7.4
55
pytest-django==3.4.2
66
pytest-describe==0.11.1
77
pytest-xdist==1.23.0
8+
pytest-cov
89
apipkg==1.5
910
execnet==1.5.0
1011

tox.ini

+12-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ skipsdist = True
66
[travis]
77
python =
88
2.7: py27
9-
3.6: py36
9+
3.6: py36, codecov
1010

1111
[testenv]
1212
description = run test suite for the application with {basepython}
@@ -16,10 +16,11 @@ setenv =
1616
LANG=C
1717
LC_CTYPE=C.UTF-8
1818
DJANGO_SETTINGS_SKIP_LOCAL=True
19+
passenv = CI TRAVIS TRAVIS_*
1920
deps = -r{toxinidir}/requirements/testing.txt
2021
changedir = {toxinidir}/readthedocs
2122
commands =
22-
py.test {posargs}
23+
py.test --cov-report= --cov-config {toxinidir}/.coveragerc --cov=. {posargs}
2324

2425
[testenv:docs]
2526
description = build readthedocs documentation
@@ -53,12 +54,15 @@ commands =
5354
npm run lint
5455
5556
[testenv:coverage]
56-
description = run test suite with code coverage for the application with {basepython}
57-
deps =
58-
-r{toxinidir}/requirements/testing.txt
59-
pytest-cov
57+
description = shows the coverage report
58+
deps = coverage
6059
whitelist_externals = echo
6160
commands =
62-
py.test --disable-pytest-warnings \
63-
--cov-report=term --cov-report=html --cov-config {toxinidir}/.coveragerc --cov=. {posargs}
61+
coverage report --show-missing
62+
coverage html
6463
echo Annotated HTML coverage report is in {toxinidir}/readthedocs/htmlcov/index.html
64+
65+
[testenv:codecov]
66+
description = upload coverage report
67+
deps = codecov
68+
commands = codecov

0 commit comments

Comments
 (0)