Skip to content

Commit

Permalink
Adding tox setup for testing
Browse files Browse the repository at this point in the history
Allows for more consistent testing (CI and local) through the use of tox
controlled virtualenv's to execute your tests.

Also, switched the Travis CI config to use the project's tox setup.

New way of executing your tests:
# If needed
pip install tox

# Execute tox
tox
  • Loading branch information
jmvrbanac committed Feb 21, 2015
1 parent 735f2a0 commit 2ea3fd4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
mp-virtualenv
.idea
.*deps
.tox
mailpile.egg-info/
mailpile-tmp.py
mailpile/www/default/config.codekit
Expand Down
20 changes: 11 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
language: python
python:
- "2.7"
python: 2.7
env:
- TOX_ENV=py27

before_install:
- sudo apt-get update
- sudo apt-get install gnupg
- sudo apt-get install -y gnupg

install:
- pip install -r requirements.txt --use-mirrors
- pip install coverage coveralls nose --use-mirrors
- pip install tox coveralls

script:
- "python setup.py install"
- "nosetests mailpile.tests --with-coverage --cover-package=mailpile"
after_success:
- "coveralls"
- tox -e $TOX_ENV

after_success:
- coveralls
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ selenium>=2.40.0
mock>=1.0.1
coverage
nose
tox
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[tox]
envlist = py27

[testenv]
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = nosetests {toxinidir}/mailpile/tests --with-coverage --cover-package=mailpile

0 comments on commit 2ea3fd4

Please sign in to comment.