diff options
author | Daniel Hahler <git@thequod.de> | 2019-03-01 12:31:44 +0100 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-03-01 13:02:25 +0100 |
commit | e5572e95aaf08e4ee88e4ddcec38b0906d87741b (patch) | |
tree | 0ed6244a5d10190825a06862fbc8436651a57e0c | |
parent | f0badf18389935b0275660f8f3ef9899dc4c4f49 (diff) | |
download | isort-e5572e95aaf08e4ee88e4ddcec38b0906d87741b.tar.gz |
Report coverage
- add coverage factor to tox
- report coverage to codecov.io
- configure testpaths for pytest, instead of passing it through tox
command
-rw-r--r-- | .coveragerc | 12 | ||||
-rw-r--r-- | .travis.yml | 20 | ||||
-rw-r--r-- | README.rst | 7 | ||||
-rw-r--r-- | setup.cfg | 3 | ||||
-rw-r--r-- | tox.ini | 5 |
5 files changed, 38 insertions, 9 deletions
diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..191bc937 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,12 @@ +[run] +include = + isort/* + test_*.py + .tox/*/lib/python*/site-packages/isort/* + .tox\*\Lib\site-packages\isort\* +branch = 1 + +[paths] +source = isort/ + .tox/*/lib/python*/site-packages/isort/ + .tox\*\Lib\site-packages\isort\ diff --git a/.travis.yml b/.travis.yml index 9c711d42..1fbffbab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,16 +11,28 @@ matrix: - python: 3.7 env: TOXENV=mypy - python: 3.4 - env: TOXENV=py34 + env: TOXENV=py34-coverage - python: 3.5 - env: TOXENV=py35 + env: TOXENV=py35-coverage - python: 3.6 - env: TOXENV=py36 + env: TOXENV=py36-coverage - python: 3.7 - env: TOXENV=py37 + env: TOXENV=py37-coverage - python: pypy3.5-6.0 env: TOXENV=pypy3 install: - pip install tox script: - tox +after_success: + - | + # Report coverage for TOXENV=*-coverage. + if [[ "${TOXENV%-coverage}" != "$TOXENV" ]]; then + set -e + # Add last TOXENV to $PATH. + PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH" + coverage xml + coverage report -m + bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -n $TOXENV + set +e + fi @@ -11,10 +11,9 @@ :target: https://travis-ci.org/timothycrosley/isort :alt: Build Status - -.. image:: https://coveralls.io/repos/timothycrosley/isort/badge.svg?branch=release%2F2.6.0&service=github - :target: https://coveralls.io/github/timothycrosley/isort?branch=release%2F2.6.0 - :alt: Coverage +.. image:: https://codecov.io/gh/timothycrosley/isort/branch/develop/graph/badge.svg + :target: https://codecov.io/gh/timothycrosley/isort + :alt: Code coverage Status .. image:: https://img.shields.io/github/license/mashape/apistatus.svg :target: https://pypi.org/project/hug/ @@ -18,3 +18,6 @@ follow_imports = silent ignore_missing_imports = True strict_optional = False warn_no_return = False + +[tool:pytest] +testpaths = test_isort.py @@ -9,11 +9,14 @@ envlist = [testenv] deps = pytest + coverage: pytest-cov extras = pipfile pyproject requirements -commands = py.test test_isort.py {posargs} +setenv = + coverage: PYTEST_ADDOPTS=--cov {env:PYTEST_ADDOPTS:} +commands = pytest {posargs} [testenv:isort-check] basepython = python3 |