From edaa82622bcd4fbdcaa60568cabf382774747dcf Mon Sep 17 00:00:00 2001 From: Viktor Villainov Date: Tue, 1 Jan 2019 07:00:18 -0500 Subject: [PATCH] Configure CI with tox and coverage --- .coveragerc | 3 +++ .travis.yml | 18 ++++++++++++------ tox.ini | 16 ++++++++++++++-- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..fe258c6 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[report] +exclude_lines = + if __name__ == .__main__.: diff --git a/.travis.yml b/.travis.yml index 9fcb966..6fe9382 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,16 @@ language: python sudo: required dist: xenial -python: - - "3.5" - - "3.6" - - "3.7" +matrix: + include: + - python: 3.7 + env: TOXENV=py,codecov + - python: 3.6 + env: TOXENV=py,codecov + - python: 3.5 + env: TOXENV=py,codecov -install: pip install -e . -script: python -m unittest +install: + - pip install tox + +script: tox diff --git a/tox.ini b/tox.ini index 9471ff8..c19cefd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,18 @@ [tox] -envlist = py36, py37 +envlist = py35, py36, py37 [testenv] +deps = + coverage + commands = - python -m unittest + coverage run --include=i2plib/* -m unittest + +[testenv:codecov] +passenv = CI TRAVIS TRAVIS_* +deps = codecov +skip_install = true +commands = + coverage combine + coverage report + codecov