Skip to content

Commit

Permalink
Merge pull request #4605 from stsewd/run-coverage
Browse files Browse the repository at this point in the history
Run coverage on travis
  • Loading branch information
stsewd committed Oct 22, 2018
2 parents c764af6 + 326d621 commit a4291d1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
comment:
layout: "diff, files"
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
[run]
branch = true
source = .
omit =
*/**/migrations/*
*/**/management/commands/*
*/**/settings/*
*/**/settings.py
analytics/vendor/*
rtd_tests/*
*/**/tests/**
wsgi.py

[report]
exclude_lines =
if self.debug:
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
1 change: 1 addition & 0 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pytest==3.7.4
pytest-django==3.4.2
pytest-describe==0.11.1
pytest-xdist==1.23.0
pytest-cov
apipkg==1.5
execnet==1.5.0

Expand Down
20 changes: 12 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ skipsdist = True
[travis]
python =
2.7: py27
3.6: py36
3.6: py36, codecov

[testenv]
description = run test suite for the application with {basepython}
Expand All @@ -16,10 +16,11 @@ setenv =
LANG=C
LC_CTYPE=C.UTF-8
DJANGO_SETTINGS_SKIP_LOCAL=True
passenv = CI TRAVIS TRAVIS_*
deps = -r{toxinidir}/requirements/testing.txt
changedir = {toxinidir}/readthedocs
commands =
py.test {posargs}
py.test --cov-report= --cov-config {toxinidir}/.coveragerc --cov=. {posargs}

[testenv:docs]
description = build readthedocs documentation
Expand Down Expand Up @@ -53,12 +54,15 @@ commands =
npm run lint
[testenv:coverage]
description = run test suite with code coverage for the application with {basepython}
deps =
-r{toxinidir}/requirements/testing.txt
pytest-cov
description = shows the coverage report
deps = coverage
whitelist_externals = echo
commands =
py.test --disable-pytest-warnings \
--cov-report=term --cov-report=html --cov-config {toxinidir}/.coveragerc --cov=. {posargs}
coverage report --show-missing
coverage html
echo Annotated HTML coverage report is in {toxinidir}/readthedocs/htmlcov/index.html
[testenv:codecov]
description = upload coverage report
deps = codecov
commands = codecov

0 comments on commit a4291d1

Please sign in to comment.