diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..f7fe24f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,22 @@ +[run] +branch = True + +[paths] +source = vdirsyncer/ + +[report] +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain about missing debug-only code: + def __repr__ + if self\.debug + + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError + raise NotImplementedError + + # Don't complain if non-runnable code isn't run: + if 0: + if __name__ == .__main__.: diff --git a/.travis.yml b/.travis.yml index 1041468..eb316be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ { + "after_script": [ + "make -e after-$BUILD" + ], "branches": { "only": [ "auto", diff --git a/Makefile b/Makefile index 7251402..f50b0ae 100644 --- a/Makefile +++ b/Makefile @@ -28,19 +28,19 @@ install-test: install-servers git+https://github.com/DRMacIver/hypothesis \ git+https://github.com/pytest-dev/pytest; \ fi - [ $(CI) != "true" ] || pip install coverage codecov + [ $(CI) != "true" ] || pip install pytest-cov codecov test: + set -e; \ if [ "$(CI)" = "true" ]; then \ - coverage run --branch --concurrency=thread --source=vdirsyncer/ --module pytest; \ + py.test --cov-config .coveragerc; \ else \ py.test; \ - fi; \ - STATUS="$$?"; \ - set -e; \ - [ "$(CI)" != "true" ] || codecov; \ - [ "$(CI)" != "true" ] || scripts/upload-hypothesis-db.sh; \ - [ "$$STATUS" = "0" ] + fi + +after-test: + [ "$(CI)" != "true" ] || codecov + [ "$(CI)" != "true" ] || scripts/upload-hypothesis-db.sh install-style: install-docs pip install flake8 flake8-import-order flake8-bugbear @@ -52,6 +52,9 @@ style: sphinx-build -W -b html ./docs/ ./docs/_build/html/ python3 scripts/make_travisconf.py | diff -b .travis.yml - +after-style: + true + travis-conf: python3 scripts/make_travisconf.py > .travis.yml @@ -61,6 +64,9 @@ install-docs: docs: cd docs && make html +after-docs: + true + sh: # open subshell with default test config $$SHELL; diff --git a/scripts/make_travisconf.py b/scripts/make_travisconf.py index 037f1d3..7dc31bc 100644 --- a/scripts/make_travisconf.py +++ b/scripts/make_travisconf.py @@ -27,6 +27,7 @@ make -e install-$BUILD; """] cfg['script'] = ["make -e $BUILD"] +cfg['after_script'] = ["make -e after-$BUILD"] matrix = [] cfg['matrix'] = {'include': matrix}