How to run Tox with Travis-CI
<p>How do you test different Python versions with <a href="https://pypi.python.org/pypi/tox" rel="noreferrer">Tox</a> from within <a href="https://travis-ci.org/" rel="noreferrer">Travis-CI</a>?</p>

<p>I have a <code>tox.ini</code>:</p>

<pre><code>[tox]
envlist = py{27,33,34,35}
recreate = True

[testenv]
basepython =
    py27: python2.7
    py33: python3.3
    py34: python3.4
    py35: python3.5
deps =
    -r{toxinidir}/pip-requirements.txt
    -r{toxinidir}/pip-requirements-test.txt
commands = py.test
</code></pre>

<p>which runs my Python unittests in several Python versions and works perfectly.</p>

<p>I want to setup a build in Travis-CI to automatically run this when I push changes to Github, so I have a <code>.travis.yml</code>:</p>

<pre><code>language: python
python:
-   "2.7"
-   "3.3"
-   "3.4"
-   "3.5"
install:
-   pip install tox
script:
-   tox
</code></pre>

<p>This technically seems to work, but it redundantly runs all my tests in each version of Python...from each version of Python. So a build that takes 5 minutes now takes 45 minutes.</p>

<p>I tried removing the <code>python</code> list from my yaml file, so Travis will only run a single Python instance, but that causes my Python3.5 tests to fail because the 3.5 interpreter can't be found. Apparently, that's a <a href="https://github.com/travis-ci/travis-ci/issues/4794" rel="noreferrer">known limitation</a> as Travis-CI won't install Python3.5 unless you specify that exact version in your config...but it doesn't do that for the other versions.</p>

<p>Is there a way I can workaround this?</p>