13

I am using python tox to run python unittest for several versions of python, but these python interpreters are not all available on all machines or platforms where I'm running tox.

How can I configure tox so it will run tests only when python interpretors are available.

Example of tox.ini:

[tox]
envlist=py25,py27

[testenv]
...
[testenv:py25]
...

The big problem is that I do want to have a list of python environments which is auto-detected.

1
  • Doesn't it already do that? I recall that is detects missing interpreters and skips the associated tests (quite quickly too).
    – user395760
    Nov 13, 2012 at 17:46

3 Answers 3

17

As of Tox version 1.7.2, you can pass the --skip-missing-interpreters flag to achieve this behavior. You can also set skip_missing_interpreters=true in your tox.ini file. More info here.

[tox]
envlist =
    py24, py25, py26, py27, py30, py31, py32, py33, py34, jython, pypy, pypy3
skip_missing_interpreters =
    true
0

First if you don't have tox : pip install tox.

Use this command : tox --skip-missing-interpreters , it skips for the compilers which are not available locally and just runs for the available versions of python

-3

tox will display an Error if an interpreter cannot be found. Question is up if there should be a "SKIPPED" state and making tox return a "0" success result. This should probably be explicitely enabled via a command line option. If you agree, file an issue at http://bitbucket.org/hpk42/tox .

4
  • 1
    I added a feature request bitbucket.org/hpk42/tox/issue/59/… Tx
    – sorin
    Nov 14, 2012 at 12:45
  • 1
    You could recommend usage of SO for most tox/pytest relates questions - as main support option. It's much better than any mailinglist. Still, mailing list has it's use.
    – sorin
    Nov 14, 2012 at 12:46
  • 1
    i think i am already recommending it, at least for pytest. Only caveat is that answers that were good 3 years ago might not be good/valid anymore now.
    – hpk42
    Nov 14, 2012 at 18:08
  • I can only hope that SO will change the policy regarding accepted answers, the pressure is building so it will happen eventually.
    – sorin
    Nov 14, 2012 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.