From bc98ff73bed9b4eb46609764d66aa3a2e5fb6aec Mon Sep 17 00:00:00 2001 From: Paul Brown Date: Sun, 29 Jan 2017 20:48:02 -0600 Subject: [PATCH] add tox.ini, use tox with travis --- .gitignore | 1 + .travis.yml | 8 ++++---- README.rst | 2 ++ requirements-dev.txt | 1 - tox.ini | 13 +++++++++++++ 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 7b54a2086..1e41ae5ae 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ examples/appengine/lib env *.egg .eggs +.tox/ diff --git a/.travis.yml b/.travis.yml index f4cb69f0e..94e792aa6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ python: - "3.3" - "3.4" - "3.5" + - "3.6" env: - WTFORMS_VERSION=1 @@ -17,17 +18,16 @@ addons: services: - postgresql - mongodb - + before_script: - psql -U postgres -c 'CREATE DATABASE flask_admin_test;' - psql -U postgres -c 'CREATE EXTENSION postgis;' flask_admin_test - psql -U postgres -c 'CREATE EXTENSION hstore;' flask_admin_test install: - - pip install "wtforms<$WTFORMS_VERSION.99" - - pip install -r requirements-dev.txt + - pip install tox -script: nosetests flask_admin/tests --with-coverage --cover-erase --cover-inclusive +script: tox -e py-WTForms$WTFORMS_VERSION after_success: - coveralls diff --git a/README.rst b/README.rst index 0c31d86cf..e285ee4e7 100644 --- a/README.rst +++ b/README.rst @@ -95,6 +95,8 @@ For all the tests to pass successfully, you'll need Postgres & MongoDB to be run CREATE DATABASE flask_admin_test; CREATE EXTENSION postgis; +You can also run the tests on multiple environments using *tox*. + 3rd Party Stuff --------------- diff --git a/requirements-dev.txt b/requirements-dev.txt index 0baa29465..e10e904c3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,4 @@ Flask>=0.7 -wtforms Flask-SQLAlchemy>=0.15 peewee wtf-peewee diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..10a897d7b --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ +[tox] +envlist = py{26,27,33,34,35,36}-WTForms{1,2} +skipsdist = true +skip_missing_interpreters = true + +[testenv] +usedevelop = true +deps = + WTForms1: WTForms==1.0.5 + WTForms2: WTForms>=2.0 + -r{toxinidir}/requirements-dev.txt +commands = + nosetests flask_admin/tests --with-coverage --cover-erase --cover-inclusive