Skip to content

Commit

Permalink
Coverage for tests (#22)
Browse files Browse the repository at this point in the history
Fixes #21
  • Loading branch information
moggers87 authored Nov 30, 2019
1 parent 00213db commit ede4317
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
branch = true
source = sendfile
omit =
*/_version.py
*/tests.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
/build
.Python
.tox
/examples/protected_downloads/htmlcov
/examples/protected_downloads/.coverage
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ python:
- pypy2.7-6.0
- pypy3.5-6.0

install: travis_retry pip install -q tox

script: tox -e py # run tox for the current version of Python
install: pip install tox-travis codecov

script: tox

after_success:
- cd examples/protected_downloads
- codecov

matrix:
include:
Expand Down
26 changes: 25 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
[tox]
envlist =
clean
py{py,27,py3,35,36,37}-django111
py{py3,35,36,37,38}-django{21,22}
flake8
coverage

[testenv]
usedevelop=True
deps =
django111: Django>=1.11,<1.12
django21: Django>=2.1,<2.2
django22: Django>=2.2,<2.3
coverage
changedir = examples/protected_downloads
commands =
python --version
python manage.py test sendfile {posargs}
coverage run --rcfile=../../.coveragerc -a manage.py test sendfile {posargs}

[travis]
python =
pypy: clean,pypy,coverage
pypy3: clean,pypy3,coverage
2.7: clean,py27,coverage
3.5: clean,py35,coverage
3.6: clean,py36,coverage
3.7: clean,py37,coverage
3.8: clean,py38,coverage

[testenv:clean]
basepython = python3
deps = coverage
commands = coverage erase

[testenv:coverage]
basepython = python3
deps = coverage
commands =
coverage report
coverage html

[testenv:flake8]
basepython=python
Expand Down

0 comments on commit ede4317

Please sign in to comment.