summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.codecov.yml28
-rw-r--r--.gitignore5
-rw-r--r--pytest.ini2
-rwxr-xr-xsetup.py2
-rw-r--r--tox.ini7
5 files changed, 42 insertions, 2 deletions
diff --git a/.codecov.yml b/.codecov.yml
new file mode 100644
index 00000000..9fff0529
--- /dev/null
+++ b/.codecov.yml
@@ -0,0 +1,28 @@
+codecov:
+ bot: codecov
+ notify:
+ require_ci_to_pass: yes
+
+coverage:
+ precision: 2
+ round: down
+ range: "70...100"
+
+ status:
+ # Only consider coverage of the code snippet changed in PR
+ project: no
+ patch: yes
+ changes: no
+
+parsers:
+ gcov:
+ branch_detection:
+ conditional: yes
+ loop: yes
+ method: no
+ macro: no
+
+comment:
+ layout: "header, diff"
+ behavior: default
+ require_changes: no
diff --git a/.gitignore b/.gitignore
index b9795718..fe9a20b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,8 @@ sphinx/source/_build
# test results in junit format for Appveyor
/junit-test-results.xml
+
+# coverage results
+/.coverage
+/coverage.xml
+/graph_Request_*.png
diff --git a/pytest.ini b/pytest.ini
index bb2ff6e8..09493bf6 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,4 +1,4 @@
[pytest]
norecursedirs=dist build .tox
-addopts=-v -rxs --junitxml=junit-test-results.xml
+addopts=-v -rxs --junitxml=junit-test-results.xml --cov=cherrypy --cov-report term-missing:skip-covered --cov-report xml
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
diff --git a/setup.py b/setup.py
index 8c10bc34..705aaded 100755
--- a/setup.py
+++ b/setup.py
@@ -80,11 +80,13 @@ extras_require = {
'ssl': ['pyOpenSSL'],
'testing': [
'coverage', # inspects tests coverage
+ 'codecov', # sends tests coverage to codecov.io
# cherrypy.lib.gctools
'objgraph',
'pytest>=2.8',
+ 'pytest-cov',
'pytest-sugar',
'backports.unittest_mock',
],
diff --git a/tox.ini b/tox.ini
index 332ce9b8..b19a338c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,7 +5,12 @@ envlist = python
usedevelop = True
commands =
pytest {posargs}
-passenv = WEBTEST_INTERACTIVE
+ codecov
+passenv =
+ WEBTEST_INTERACTIVE
+ CI
+ TRAVIS
+ TRAVIS_*
setenv =
WEBTEST_INTERACTIVE=false
extras =