From e86824e5bb8b59290d4bf39423a25ef649654406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 8 Mar 2016 13:51:42 +0100 Subject: [PATCH] Added Tox for unit testing on different versions of Python --- .gitignore | 5 +++++ .travis.yml | 25 +++++++++++++++++++++++++ requirements.txt | 10 ++++++++++ tox.ini | 20 ++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 .travis.yml create mode 100644 requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 0caf0d3..f953e69 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ *.pyc +.*.swp *.sublime-project *.sublime-workspace dist/ MANIFEST +/.coverage +/.cache/ +/.tox/ +/pillar_sdk.egg-info/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fa172f5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: python + +# Python 3.5 specified to make tox environment 'py35' work. +# See: https://github.com/travis-ci/travis-ci/issues/4794 +python: + - 3.5 + +# Environment changes have to be manually synced with 'tox.ini'. +# See: https://github.com/travis-ci/travis-ci/issues/3024 +env: + - TOXENV=py27 + - TOXENV=py34 + - TOXENV=py35 + +install: + - pip install -r requirements.txt + - pip install coveralls + +script: + - tox + +after_success: + # Coveralls submission only for py35 environment, because of being the only + # one that executes doctest-modules testing, according to tox.ini. + - if [ ${TOXENV} = "py35" ]; then coveralls; fi diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..13d80f1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +pyOpenSSL==0.15.1 +requests==2.9.1 +six==1.10.0 + +tox>=2.3.1 +wheel>=0.29.0 +coverage>=3.5 +PyTest +pytest-xdist +pytest-cov diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..597ddb1 --- /dev/null +++ b/tox.ini @@ -0,0 +1,20 @@ +[tox] +# Environment changes have to be manually synced with '.travis.yml'. +envlist = py27,py34,py35 + +[pytest] +addopts = -v --cov pillarsdk --cov-report term-missing + +[testenv] +commands=py.test [] +deps=coverage >=3.5 + PyTest + pytest-xdist + pytest-cov + +; For now we skip doctests. +;[testenv:py35] +;commands=py.test --doctest-modules [] + +[pep8] +max-line-length = 100