From 902aff1e7e5784455f3e5aab546b55878313901d Mon Sep 17 00:00:00 2001 From: Shay Palachy Date: Thu, 20 Apr 2017 12:08:44 +0300 Subject: [PATCH] fix for python 2.7 test dependency and added a tox.ini file --- .codecov.yml | 28 ++++++++++++++++++++++++++++ .coveragerc | 9 ++++++++- .travis.yml | 2 +- codecov.yml | 12 ------------ tox.ini | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 14 deletions(-) create mode 100644 .codecov.yml delete mode 100644 codecov.yml create mode 100644 tox.ini diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..9186d88 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,28 @@ +codecov: + notify: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + ignore: Tests + status: + patch: + default: + target: '80' + project: false + +comment: + layout: header, changes, diff + behavior: default + require_changes: false + branches: null + flags: null + paths: null + +ignore: + - "versioneer.py" + - "tests" + - "**/_version.py" + - "**/__init__.py" \ No newline at end of file diff --git a/.coveragerc b/.coveragerc index 7b4a138..79b437a 100644 --- a/.coveragerc +++ b/.coveragerc @@ -5,4 +5,11 @@ omit = cachier/_version.py cachier/__init__.py [report] -show_missing = True \ No newline at end of file +show_missing = True +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + + # Don't complain if tests don't hit defensive assertion code: + raise NotImplementedError \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index e57f24c..7144b7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: - pip install codecov install: # Coveralls 4.0 doesn't support Python 3.2 - - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then travis_retry pip install repoze; fi + - if [ "$TRAVIS_PYTHON_VERSION" == "2.7" ]; then travis_retry pip install repoze.lru; fi - pip install ".[test]" script: pytest --cov=pcachier # submit coverage diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 9a6118d..0000000 --- a/codecov.yml +++ /dev/null @@ -1,12 +0,0 @@ -comment: - layout: header, changes, diff -coverage: - status: - patch: - default: - target: '80' - project: false -ignore: - - "tests" - - "**/_version.py" - - "**/__init__.py" \ No newline at end of file diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..9b36c54 --- /dev/null +++ b/tox.ini @@ -0,0 +1,32 @@ +[tox] +envlist = + py35 + # doctesting + ;,py36 +# recreate = True + +[testenv] +deps = + ; equivalent to pip -e .[test] + -e{toxinidir}[test] + ;-r{toxinidir}/tools/pip-requires + ;-r{toxinidir}/tools/test-require +commands=py.test # or 'nosetests' or ... +usedevelop = true + +# [testenv:doctesting] +# basepython = python +# usedevelop=True +# skipsdist=True +# commands= +# pytest --doctest-modules --pyargs _pytest + +[pytest] +testpaths = + tests + cachier +norecursedirs=dist build .tox +addopts = + # --doctest-modules + --cov=cachier +