Ensure tests run under python2.7

tox uses whatever python version that tox ran with as the default python
version for environments (py27,py3x, etc are given a more specific
default).

Debian's python-tox (for example) uses python3, but we require python2.7
- and a naive `apt-get install python-tox; tox -epep8` fails with
py3-related errors on Debian.

This change explicitly sets `basepython = python2.7` in several testing
environments that would otherwise have used the default basepython.

Change-Id: I377ac6d72dec5b85c105d8a1a74f6974efb84dcf
This commit is contained in:
Angus Lees 2015-03-02 17:06:54 +11:00
parent d283e23d76
commit 40783cee5e

View File

@ -26,9 +26,11 @@ commands =
setenv = VIRTUAL_ENV={envdir}
[testenv:api]
basepython = python2.7
setenv = OS_TEST_PATH=./neutron/tests/api
[testenv:functional]
basepython = python2.7
setenv = OS_TEST_PATH=./neutron/tests/functional
OS_TEST_TIMEOUT=90
deps =
@ -36,6 +38,7 @@ deps =
-r{toxinidir}/neutron/tests/functional/requirements.txt
[testenv:dsvm-functional]
basepython = python2.7
setenv = OS_TEST_PATH=./neutron/tests/functional
OS_SUDO_TESTING=1
OS_ROOTWRAP_CMD=sudo {envbindir}/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
@ -50,6 +53,7 @@ sitepackages = True
downloadcache = ~/cache/pip
[testenv:pep8]
basepython = python2.7
deps =
{[testenv]deps}
pylint
@ -62,6 +66,7 @@ commands=
whitelist_externals = sh
[testenv:cover]
basepython = python2.7
commands =
python setup.py testr --coverage --testr-args='{posargs}'