]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Ensure tests run under python2.7
authorAngus Lees <gus@inodes.org>
Mon, 2 Mar 2015 06:06:54 +0000 (17:06 +1100)
committerAngus Lees <gus@inodes.org>
Mon, 2 Mar 2015 06:06:54 +0000 (17:06 +1100)
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

tox.ini

diff --git a/tox.ini b/tox.ini
index 54d916123105e3d592194608e4f3e8badd109c5d..e09a40422601971359415c91ec54456e93bb98f5 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -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}'