fix tox python3 overrides

We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I9a6e4950e2915fb551c35eba8c78a6b4bb4d932b
This commit is contained in:
huang.zhiping 2018-06-08 13:57:17 +08:00 committed by Alessandro Nesta
parent 0c1496145e
commit b5ccba0891
1 changed files with 11 additions and 2 deletions

13
tox.ini
View File

@ -21,29 +21,33 @@ commands =
rm -Rf .testrepository/times.dbm
[testenv:py27]
basepython = python2.7
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py27-postgresql]
basepython = python2.7
commands =
{[testenv]commands}
{toxinidir}/tools/run_pifpaf.sh '{posargs}'
[testenv:py35]
basepython = python3
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py35-postgresql]
basepython = python3
commands =
{[testenv]commands}
{toxinidir}/tools/run_pifpaf.sh '{posargs}'
[testenv:functional]
basepython=python3.5
basepython=python3
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
@ -53,7 +57,7 @@ commands =
py.test -svx {toxinidir}/deckhand/tests/common/test_gabbi.py -k '{posargs}'
[testenv:functional-dev]
basepython=python3.5
basepython=python3
# Minimalistic functional test job for running Deckhand functional tests
# via uwsgi. Uses pifpaf for DB instantiation. Useful for developers.
# Requires PostgreSQL be installed on host.
@ -65,6 +69,7 @@ commands =
pifpaf run postgresql -- {toxinidir}/tools/functional-tests.sh "{posargs}"
[testenv:cover]
basepython = python3
setenv = {[testenv]setenv}
PYTHON=coverage run --source deckhand --parallel-mode
commands =
@ -77,15 +82,19 @@ commands =
coverage report
[testenv:bandit]
basepython = python3
commands = bandit -r deckhand -x deckhand/tests -n 5
[testenv:genconfig]
basepython = python3
commands = oslo-config-generator --config-file=etc/deckhand/config-generator.conf
[testenv:genpolicy]
basepython = python3
commands = oslopolicy-sample-generator --config-file=etc/deckhand/policy-generator.conf
[testenv:pep8]
basepython = python3
deps =
.[bandit]
{[testenv]deps}