diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..b3f29fa --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[paths] +source = + daphne/ + +[report] +omit = + .tox/* diff --git a/.travis.yml b/.travis.yml index 6f34248..4913089 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,17 @@ sudo: false language: python python: - - "2.7" - - "3.5" +- "3.5" +env: + global: + - PIP_RETRIES=10 + - PIP_TIMEOUT=30 + matrix: + - TOXENV=py27 + - TOXENV=py35 install: - - if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install unittest2; fi - - pip install asgiref twisted autobahn -script: if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then python -m unittest2; else python -m unittest; fi +- travis_retry pip install tox codecov +script: +- tox +after_success: +- codecov diff --git a/README.rst b/README.rst index 79ee5c2..e0298b0 100644 --- a/README.rst +++ b/README.rst @@ -3,10 +3,13 @@ daphne .. image:: https://api.travis-ci.org/andrewgodwin/daphne.svg :target: https://travis-ci.org/andrewgodwin/daphne - + .. image:: https://img.shields.io/pypi/v/daphne.svg :target: https://pypi.python.org/pypi/daphne +.. image:: https://codecov.io/github/andrewgodwin/daphne/coverage.svg?branch=master + :target: https://codecov.io/github/andrewgodwin/daphne?branch=master + Daphne is a HTTP, HTTP2 and WebSocket protocol server for `ASGI `_, and developed to power Django Channels. diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..9ef6dcf --- /dev/null +++ b/tox.ini @@ -0,0 +1,25 @@ +[tox] +envlist = py{27,35} + +[base] +commands = + coverage report -m + +[testenv] +usedevelop = true +commands = + coverage run -m unittest + {[base]commands} +deps = + asgiref + twisted + autobahn + coverage + +[testenv:py27] +commands = + coverage run -m unittest2 + {[base]commands} +deps = + unittest2 + {[testenv]deps}