Skip to content

Commit

Permalink
Adding tox - test & coverage automation config script. Also playing w…
Browse files Browse the repository at this point in the history
…ith travis CI pipelines.
  • Loading branch information
Michał Kaczmarczyk committed Feb 26, 2019
1 parent 6bb6a4a commit 722dd2c
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage*
.cache
nosetests.xml
coverage.xml
.pytest_cache

# Translations
*.mo
Expand Down
47 changes: 44 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: python
dist: xenial
sudo: false

python:
- 2.7
Expand All @@ -8,7 +9,47 @@ python:
- 3.6
- 3.7

before_install:
- uname -a
- python --version
- virtualenv --version
- pip --version

install:
- pip install tox
- tox --version

stages:
- check
- test
- coverage_report

matrix:
include:
- stage: check
python: '2.7'
env: TOXENV=check27
- python: '3.6'
env: TOXENV=check36

- stage: test
python: '2.7'
env: TOXENV=py27
- python: 'pypy'
env: TOXENV=pypy
- python: '3.4'
env: TOXENV=py34
- python: '3.5'
env: TOXENV=py35
- python: '3.6'
env: TOXENV=py36

- stage: coverage_report
- python: '3.6'
env: TOXENV=coverage


script:
- python setup.py install
- pip install pytest
- py.test
- tox -v

cache: pip
63 changes: 63 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[tox]
envlist =
check{27,36},
py{27,py,34,35,36,37},
coverage


[testenv]
usedevelop = true
setenv =
COVERAGE_FILE={toxinidir}/.coverage_{envname}
deps =
pdbpp==0.9.6
pytest==3.10.1
pytest-cov==2.6.1
whitelist_externals =
rm
commands =
rm -vf {toxinidir}/.coverage_{envname}
pytest --cov-report= --cov=obd {posargs}

[testenv:check27]
basepython = python2.7
skipsdist = true
deps =
check-manifest==0.37
flake8==3.7.7
commands =
flake8 {envsitepackagesdir}/obd
python setup.py check --strict --metadata


[testenv:check36]
basepython = python3.6
skipsdist = true
deps = {[testenv:check27]deps}
commands = {[testenv:check27]commands}


[testenv:coverage]
skipsdist = true
deps =
coverage
whitelist_externals =
/bin/bash
rm
commands =
/bin/bash -c 'coverage combine {toxinidir}/.coverage_*'
coverage html -i
coverage report -i --show-missing

[flake8]
max-line-length = 120


[coverage:run]
omit =
.tox/*
env/*

[coverage:paths]
source =
obd/

0 comments on commit 722dd2c

Please sign in to comment.