Skip to content

Commit

Permalink
Switched travis testing to tox
Browse files Browse the repository at this point in the history
  • Loading branch information
anx-ckreuzberger committed May 8, 2018
1 parent ddeb303 commit 3941bb8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 53 deletions.
62 changes: 13 additions & 49 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,31 @@
sudo: false
language: python
python: # test various python versions (Django Support for various python versions is described within the exclude: section)
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"
- "pypy" # PyPy2
- "pypy3" # PyPy3
- "nightly" # currently points to 3.7-dev
env:
matrix:
#####################################################
# Test against the initial releaes #
#####################################################
- DJANGO_VERSION=1.8 DJANGO_REST_VERSION=3.4
- DJANGO_VERSION=1.8 DJANGO_REST_VERSION=3.5
- DJANGO_VERSION=1.11 DJANGO_REST_VERSION=3.4
- DJANGO_VERSION=1.11 DJANGO_REST_VERSION=3.5
- DJANGO_VERSION=1.11 DJANGO_REST_VERSION=3.6
- DJANGO_VERSION=2.0 DJANGO_REST_VERSION=3.7
- DJANGO_VERSION=2.0 DJANGO_REST_VERSION=3.8
#####################################################
# Test against the latest minor/patch releases #
#####################################################
- DJANGO_VERSION=1.8.* DJANGO_REST_VERSION=3.4.*
- DJANGO_VERSION=1.8.* DJANGO_REST_VERSION=3.5.*
- DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.4.*
- DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.5.*
- DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.6.*
- DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.7.*
- DJANGO_VERSION=1.11.* DJANGO_REST_VERSION=3.8.*
- DJANGO_VERSION=2.0.* DJANGO_REST_VERSION=3.7.*
- DJANGO_VERSION=2.0.* DJANGO_REST_VERSION=3.8.*
- DJANGO=1.8
- DJANGO=1.11
- DJANGO=2.0
- DJANGO=master
matrix:
exclude:
# Django 2.0 does not support Python2.7/PyPy2 anymore
- { python: "2.7", env: DJANGO_VERSION=2.0 }
- { python: "pypy", env: DJANGO_VERSION=2.0 }
- { python: "2.7", env: DJANGO_VERSION=2.0.* }
- { python: "pypy", env: DJANGO_VERSION=2.0.* }
# Django 1.8 might not support newer versions of python
- { python: "3.6", env: DJANGO_VERSION=1.8 }
- { python: "3.7", env: DJANGO_VERSION=1.8 }
- { python: "pypy3", env: DJANGO_VERSION=1.8 }
- { python: "nightly", env: DJANGO_VERSION=1.8 }
- { python: "3.6", env: DJANGO_VERSION=1.8.* }
- { python: "3.7", env: DJANGO_VERSION=1.8.* }
- { python: "pypy3", env: DJANGO_VERSION=1.8.* }
- { python: "nightly", env: DJANGO_VERSION=1.8.* }
# Django >= 2.0 does not support Python2.7/PyPy2 anymore
- { python: "2.7", env: DJANGO=2.0 }
- { python: "pypy", env: DJANGO=2.0 }
- { python: "2.7", env: DJANGO=master }
- { python: "pypy", env: DJANGO=master }
allow_failures:
# newer python versions aswell as pypy may also always break our build
- python: "3.7-dev"
- python: "pypy"
- python: "pypy3"
- python: "nightly"
- env: DJANGO=master
cache:
directories:
- $HOME/.cache/pip
install:
- pip install -q Django==$DJANGO_VERSION # install custom django version
- pip install -q djangorestframework==$DJANGO_REST_VERSION # install custom django rest framework version
- pip install -q mock==2.0.0 # install unittest mocks
script:
- python setup.py install
- cd tests/
- python manage.py test # just need to run normal tests for now
install: pip install tox-travis
script: tox
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ unit tests.

Use this code snippet to run tests:
```bash
pip install -r requirements_test.txt
python setup.py install
cd tests
python manage.py test
pip install tox
tox
```

## Cache Backend
Expand Down
31 changes: 31 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[tox]
envlist =
{py27,py34,py35,pypy,pypy3}-django18-{drf35,drf36},
{py27,py34,py35,py36,pypy,pypy3}-django111-{drf35,drf36,drf37,drf38},
{py34,py35,py36,pypy3}-django20-{drf37,drf38},
{py35,py36,pypy3}-djangomaster-{drf38}

[travis:env]
DJANGO =
1.8: django18
1.11: django111
2.0: django20
master: djangomaster

[testenv]
changedir = tests
commands = python manage.py test
envdir = {toxworkdir}/venvs/{envname}
setenv =
PYTHONDONTWRITEBYTECODE=1
PYTHONWARNINGS=once
deps =
mock==2.0
drf35: djangorestframework>=3.5,<3.6
drf36: djangorestframework>=3.6,<3.7
drf37: djangorestframework>=3.7,<3.8
drf38: djangorestframework>=3.8,<3.9
django18: Django>=1.8,<1.9
django111: Django>=1.11,<2.0
django20: Django>=2.0,<2.1
djangomaster: https://github.com/django/django/archive/master.tar.gz

0 comments on commit 3941bb8

Please sign in to comment.