From bea336f16201096bad378686d9111f9987d4f5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 4 Dec 2019 16:10:30 +0100 Subject: [PATCH 1/3] Add code coverage support --- .coveragerc | 4 ++++ codecov.yml | 6 ++++++ tox.ini | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .coveragerc create mode 100644 codecov.yml diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..19aadc5 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,4 @@ +[run] +branch = true +include = src/protego.py +omit = tests/* diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..d8aa6b9 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,6 @@ +comment: + layout: "header, diff, tree" + +coverage: + status: + project: false diff --git a/tox.ini b/tox.ini index 2e27856..1205ed3 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ deps = pytest commands = python setup.py install - pytest tests + pytest --cov=scrapy --cov-report= tests [testenv:py35] basepython = python3.5 From c586e9cfba3d241bc08004b0f412abf5619088da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Thu, 5 Dec 2019 12:16:06 +0100 Subject: [PATCH 2/3] Update tox.ini --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index b57faa1..bb46ef2 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ envlist = py27,py37 [testenv] deps = pytest + pytest-cov commands = python setup.py install pytest --cov=scrapy --cov-report= {posargs:tests} From fd1105cd690a844d3a201860b00b21e9eb0540e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Mon, 9 Dec 2019 18:14:40 +0100 Subject: [PATCH 3/3] Send coverage data to codecov.io --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 31c0323..e426cf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,8 +37,10 @@ install: virtualenv --python="$PYPY_VERSION/bin/pypy3" "$HOME/virtualenvs/$PYPY_VERSION" source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate" fi -- pip install -U tox +- pip install -U codecov tox script: tox +after_success: + - codecov deploy: provider: pypi user: anubhavp