make python 3 the default for tox.ini
This patch is part of the community goals to enable python 3 first, and only use python 2 when explict. To do so, this patch: - Makes python 3 the default env for non py27 tox targets. - Addresses any py3 changes in the code. Change-Id: Iab52979bb720a8df8924108093e5119922622cb9
This commit is contained in:
parent
716527fb20
commit
ab3822413e
7
tox.ini
7
tox.ini
@ -26,7 +26,7 @@ setenv = {[testenv]setenv}
|
|||||||
commands = false
|
commands = false
|
||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
basepython = python2.7
|
basepython = python3
|
||||||
setenv = {[testenv]setenv}
|
setenv = {[testenv]setenv}
|
||||||
{[testenv:common]setenv}
|
{[testenv:common]setenv}
|
||||||
OS_TEST_PATH=./vmware_nsxlib/tests/functional
|
OS_TEST_PATH=./vmware_nsxlib/tests/functional
|
||||||
@ -36,7 +36,7 @@ deps =
|
|||||||
-r{toxinidir}/vmware_nsxlib/tests/functional/requirements.txt
|
-r{toxinidir}/vmware_nsxlib/tests/functional/requirements.txt
|
||||||
|
|
||||||
[testenv:dsvm-functional]
|
[testenv:dsvm-functional]
|
||||||
basepython = python2.7
|
basepython = python3
|
||||||
setenv = {[testenv]setenv}
|
setenv = {[testenv]setenv}
|
||||||
OS_SUDO_TESTING=1
|
OS_SUDO_TESTING=1
|
||||||
OS_FAIL_ON_MISSING_DEPS=1
|
OS_FAIL_ON_MISSING_DEPS=1
|
||||||
@ -53,6 +53,7 @@ sitepackages = True
|
|||||||
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
|
basepython = python3
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
commands =
|
commands =
|
||||||
@ -69,6 +70,7 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/re
|
|||||||
commands = bandit -r vmware_nsxlib -n 5 -ll
|
commands = bandit -r vmware_nsxlib -n 5 -ll
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
|
basepython = python3
|
||||||
commands =
|
commands =
|
||||||
python setup.py test --coverage --coverage-package-name=vmware_nsxlib --testr-args='{posargs}'
|
python setup.py test --coverage --coverage-package-name=vmware_nsxlib --testr-args='{posargs}'
|
||||||
coverage report
|
coverage report
|
||||||
@ -77,6 +79,7 @@ commands =
|
|||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
|
basepython = python3
|
||||||
commands = sphinx-build -W -b html doc/source doc/build/html
|
commands = sphinx-build -W -b html doc/source doc/build/html
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
|
@ -42,7 +42,7 @@ class NsxLibException(Exception):
|
|||||||
|
|
||||||
if six.PY2:
|
if six.PY2:
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return unicode(self.msg)
|
return unicode(self.msg) if six.PY2 else self.msg # noqa
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.msg
|
return self.msg
|
||||||
|
Loading…
Reference in New Issue
Block a user