Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convince python tox to run tests only for the available python interpreters?

Tags:

python

tox

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.

like image 543
sorin Avatar asked Nov 13 '12 17:11

sorin


People also ask

Should I use tox Python?

tox makes it easy to: Test against different versions of Python (which would have alerted Kyle that the library hadn't been tested against his install version). Test against different dependency versions. Capture and run setup steps/ad hoc commands (which Kyle could have made a mistake on / not known about)

What is a tox INI file?

A tox. ini file can be used to configure different types of packages, which is confusing at first because the tox home page suggests that tox is used to test your own packages you plan on distributing to PyPi.


1 Answers

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
like image 148
dfarrell07 Avatar answered Oct 12 '22 16:10

dfarrell07