diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..f4c5b83f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = sanic, tests +omit = site-packages + +[html] +directory = coverage \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4f6666dc..d7872c5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,11 @@ +*~ +*.egg-info +*.egg +.coverage +.coverage.* +coverage +.tox settings.py *.pyc .idea/* -.cache/* \ No newline at end of file +.cache/* diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 00000000..d11f8e8d --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,7 @@ +httptools +ujson +uvloop +aiohttp +pytest +coverage +tox diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..258395ed --- /dev/null +++ b/tox.ini @@ -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 \ No newline at end of file