Skip to content

Commit 19d8ca3

Browse files
committed
Merge pull request #142 from noirbizarre/tox
Use tox for multiversion testing, same as MongoEngine/mongoengine#960
2 parents 0bbe268 + 9d7687b commit 19d8ca3

File tree

5 files changed

+41
-27
lines changed

5 files changed

+41
-27
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ env/
1111
.DS_Store
1212
.coverage
1313
.project
14-
.pydevproject
14+
.pydevproject
15+
.tox
16+
.eggs

.travis.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
# http://travis-ci.org/#!/MongoEngine/flask_mongoengine
22
language: python
3-
services: mongodb
43
python:
54
- "2.6"
65
- "2.7"
76
- "3.3"
7+
- '3.4'
8+
- pypy
9+
- pypy3
810
env:
9-
- PYMONGO=dev MONGOENGINE=dev
10-
- PYMONGO=dev MONGOENGINE=0.7.10
11-
- PYMONGO=dev MONGOENGINE=0.8.0
12-
- PYMONGO=dev MONGOENGINE=0.8.7
13-
- PYMONGO=2.5 MONGOENGINE=dev
14-
- PYMONGO=2.5 MONGOENGINE=0.7.10
15-
- PYMONGO=2.5 MONGOENGINE=0.8.0
16-
- PYMONGO=2.5 MONGOENGINE=0.8.7
17-
- PYMONGO=2.7 MONGOENGINE=dev
18-
- PYMONGO=2.7 MONGOENGINE=0.7.10
19-
- PYMONGO=2.7 MONGOENGINE=0.8.0
20-
- PYMONGO=2.7 MONGOENGINE=0.8.7
11+
- MONGOENGINE=0.7
12+
- MONGOENGINE=0.8
13+
- MONGOENGINE=0.9
14+
- MONGOENGINE=dev
15+
before_install:
16+
- travis_retry sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
17+
- echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' |
18+
sudo tee /etc/apt/sources.list.d/mongodb.list
19+
- travis_retry sudo apt-get update
20+
- travis_retry sudo apt-get install mongodb-org-server
2121

2222
install:
23-
- if [[ $PYMONGO == 'dev' ]]; then pip install https://github.com/mongodb/mongo-python-driver/tarball/master; true; fi
24-
- if [[ $PYMONGO != 'dev' ]]; then pip install pymongo==$PYMONGO --use-mirrors; true; fi
25-
- if [[ $MONGOENGINE == 'dev' ]]; then pip install https://github.com/mongoengine/mongoengine/tarball/master; true; fi
26-
- if [[ $MONGOENGINE != 'dev' ]]; then pip install mongoengine==$MONGOENGINE --use-mirrors; true; fi
27-
- python setup.py install
23+
- travis_retry pip install tox>=1.9
24+
- travis_retry tox -e $(echo py$TRAVIS_PYTHON_VERSION-me$MONGOENGINE | tr -d . | sed -e 's/pypypy/pypy/') -- -e test
2825
script:
29-
- python setup.py nosetests
26+
- tox -e $(echo py$TRAVIS_PYTHON_VERSION-me$MONGOENGINE | tr -d . | sed -e 's/pypypy/pypy/') -- --with-coverage
27+
3028
notifications:
3129
irc: "irc.freenode.org#mongoengine"
3230
branches:

setup.cfg

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[nosetests]
2+
rednose = 1
23
verbosity = 2
34
detailed-errors = 1
4-
where = tests
5-
#with-coverage = 1
6-
#cover-html = 1
7-
#cover-html-dir = ../htmlcov
8-
#cover-package = flask_mongoengine
9-
#cover-erase = 1
5+
cover-erase = 1
6+
cover-branches = 1
7+
cover-package = flask_mongoengine
8+
tests = tests

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
except:
2121
pass
2222

23+
test_requirements = ['nose', 'rednose', 'coverage']
24+
2325
setup(
2426
name='flask-mongoengine',
2527
version='0.7.1',
@@ -40,7 +42,8 @@
4042
packages=['flask_mongoengine',
4143
'flask_mongoengine.wtf'],
4244
include_package_data=True,
43-
tests_require=['nose', 'coverage'],
45+
tests_require=test_requirements,
46+
setup_requires=test_requirements, # Allow proper nose usage with setuptools and tox
4447
classifiers=[
4548
'Development Status :: 4 - Beta',
4649
'Environment :: Web Environment',

tox.ini

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[tox]
2+
envlist = {py26,py27,py33,py34,pypy,pypy3}-{me07,me08,me09,medev}
3+
4+
[testenv]
5+
commands =
6+
python setup.py nosetests {posargs}
7+
deps =
8+
me07: mongoengine<0.8
9+
me08: mongoengine>=0.8,<0.9
10+
me09: mongoengine>=0.9
11+
medev: https://github.com/MongoEngine/mongoengine/tarball/master
12+
me0{7,8,9}: PyMongo<3.0

0 commit comments

Comments
 (0)