add tox for test and coverage automation. Add development requirements.txt

This commit is contained in:
narzeja 2016-10-15 11:56:34 +02:00
parent 993d81090c
commit 65d9b15e0c
4 changed files with 56 additions and 1 deletions

7
.coveragerc Normal file
View File

@ -0,0 +1,7 @@
[run]
branch = True
source = sanic, tests
omit = site-packages
[html]
directory = coverage

9
.gitignore vendored
View File

@ -1,4 +1,11 @@
*~
*.egg-info
*.egg
.coverage
.coverage.*
coverage
.tox
settings.py settings.py
*.pyc *.pyc
.idea/* .idea/*
.cache/* .cache/*

7
requirements-dev.txt Normal file
View File

@ -0,0 +1,7 @@
httptools
ujson
uvloop
aiohttp
pytest
coverage
tox

34
tox.ini Normal file
View File

@ -0,0 +1,34 @@
[tox]
envlist = py35, report
[testenv]
deps =
aiohttp
pytest
# pytest-cov
coverage
commands =
coverage run -m pytest tests {posargs}
mv .coverage .coverage.{envname}
basepython:
py35: python3.5
whitelist_externals =
coverage
mv
echo
[testenv:report]
commands =
coverage combine
coverage report
coverage html
echo "Open file://{toxinidir}/coverage/index.html"
basepython =
python3.5