From c4d249163465f45229e28139d5cc8a45c0c9d0cc Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 23 Dec 2018 15:00:39 +0300 Subject: [PATCH] Enable coverage testing, report with codecov We run coverage tests only in py3.6 --- .codecov.yml | 11 +++++++++++ .gitignore | 4 ++++ .travis.yml | 13 +++++++++++-- setup.cfg | 5 +++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..831d5b58 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,11 @@ +coverage: + precision: 0 + round: down + status: + patch: + default: + target: 97 + project: + default: + threshold: 1% +comment: false diff --git a/.gitignore b/.gitignore index b68ca796..a71b8d6d 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,7 @@ doc/source/_build/ # Files generated by setupegg.py mpmath.egg-info/ + +# Coverage-related files +.coverage +htmlcov/ diff --git a/.travis.yml b/.travis.yml index bc41e934..18558dfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,25 @@ python: - 3.3 - 3.4 - 3.5 - - 3.6 - 3.7-dev - pypy - pypy3.5 +matrix: + include: + - python: 3.6 + env: COVERAGE='on' install: - pip install -e .[develop] script: # Guard against invalid escapes in strings, like '\s'. - python -We:invalid -m compileall -f mpmath -q - pycodestyle - - py.test + - | + if [ -n "${COVERAGE}" ]; then + py.test --cov mpmath + else + py.test + fi +after_success: test -n "${COVERAGE}" && codecov notifications: email: false diff --git a/setup.cfg b/setup.cfg index 5a2ac07a..51475312 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,6 +32,8 @@ tests_require = mpmath[tests] tests = pytest develop = %(tests)s pycodestyle + pytest-cov + codecov [pycodestyle] select = E101,W191,W291,W293,E111,E112,E113,W292,W391 [tool:pytest] @@ -39,3 +41,6 @@ addopts = --doctest-modules --ignore=setup.py --doctest-glob='*.txt' norecursedirs = doc/source/plots demo +[coverage:run] +branch = True +omit = mpmath/tests/*