summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Edmund Crosley <timothy.crosley@gmail.com>2019-03-02 18:47:19 -0800
committerGitHub <noreply@github.com>2019-03-02 18:47:19 -0800
commit287231d25aa8cd7ac58c2c3ad5ade31feee6a078 (patch)
tree9563e98f59476261dd13ff33318fc0ad9fdd53be
parent0d7cdcdbeb5c7e60957bb19fe945c5b205fbb895 (diff)
parent36dd2e03a5e7ebe89ad5a928613c8e7062609d78 (diff)
downloadisort-287231d25aa8cd7ac58c2c3ad5ade31feee6a078.tar.gz
Merge pull request #864 from blueyed/cov
Setup coverage
-rw-r--r--.coveragerc12
-rw-r--r--.travis.yml20
-rw-r--r--README.rst7
-rw-r--r--setup.cfg3
-rw-r--r--tox.ini3
5 files changed, 37 insertions, 8 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
diff --git a/README.rst b/README.rst
index 02598b22..90e4f9a5 100644
--- a/README.rst
+++ b/README.rst
@@ -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/
diff --git a/setup.cfg b/setup.cfg
index 8d99fe19..b998bc73 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,3 +18,6 @@ follow_imports = silent
ignore_missing_imports = True
strict_optional = False
warn_no_return = False
+
+[tool:pytest]
+testpaths = test_isort.py
diff --git a/tox.ini b/tox.ini
index 2ea72f4c..95edf584 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,10 +9,13 @@ envlist =
[testenv]
deps =
pytest
+ coverage: pytest-cov
extras =
pipfile
pyproject
requirements
+setenv =
+ coverage: PYTEST_ADDOPTS=--cov {env:PYTEST_ADDOPTS:}
commands = py.test -vv -s test_isort.py {posargs}
[testenv:isort-check]