diff --git a/tox.ini b/tox.ini index d9d015c10..0434f8b52 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py35, py36 +envlist = py{27,35,36}-cov, htmlcov skip_missing_interpreters = true [testenv] @@ -10,33 +10,38 @@ basepython = py35: {env:TOXPYTHON:python3.5} py36: {env:TOXPYTHON:python3.6} deps = + # we install coverage from source until 4.3 is released, because of this: + # https://bitbucket.org/ned/coveragepy/pull-requests/118/check-source-isdir-not-just-exists-there/diff + cov: hg+https://bitbucket.org/ned/coveragepy#egg=coverage pytest -rrequirements.txt install_command = - {envpython} -m pip install -v {opts} {packages} + pip install -v {opts} {packages} commands = - # run the test suite against the package installed inside tox env - py.test {posargs:--pyargs fontTools} + # run the test suite against the package installed inside tox env. + # We use parallel mode and then combine later so that coverage.py will take + # paths like .tox/py36/lib/python3.6/site-packages/fontTools and collapse + # them into Lib/fontTools. + cov: coverage run --parallel-mode -m pytest {posargs:--pyargs fontTools} + nocov: pytest {posargs:--pyargs fontTools} -[testenv:coverage] +[testenv:htmlcov] basepython = {env:TOXPYTHON:python3.5} deps = - {[testenv]deps} - pytest-cov + hg+https://bitbucket.org/ned/coveragepy#egg=coverage skip_install = true -commands= - # measure test coverage and create html report - py.test --cov --cov-report html {posargs} +commands = + coverage combine + coverage html -[testenv:coveralls] -passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH -basepython=python3.5 +[testenv:codecov] +passenv = * +basepython = {env:TOXPYTHON:python} deps = - {[testenv:coverage]deps} - coveralls + hg+https://bitbucket.org/ned/coveragepy#egg=coverage + codecov skip_install = true ignore_outcome = true -commands= - # measure test coverage and upload report to coveralls - py.test --cov - coveralls +commands = + coverage combine + codecov --env TOXENV