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: Ia0c9884ea6c20553d2b4da8b0668b64b53ace41f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-09-26 18:49:09 -04:00 committed by Michael Dong
parent b35d07128f
commit b5cf405d30
7 changed files with 23 additions and 20 deletions

View File

@ -1,11 +1,11 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
flake8<2.6.0,>=2.5.4 # MIT
unittest2>=1.1.0 # BSD
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
hacking<0.10,>=0.9.2
hacking>=1.1.0
flake8<2.7.0,>=2.6.0 # MIT
mock>=2.0.0 # BSD
python-subunit>=0.0.18 # Apache-2.0/BSD
testrepository>=0.0.18 # Apache-2.0/BSD
@ -16,4 +16,4 @@ requests-mock>=1.1.0 # Apache-2.0
sphinx>=1.6.2 # BSD
oslosphinx>=4.7.0 # Apache-2.0
beautifulsoup4>=4.6.0 # MIT
pylint==1.4.5 # GPLv2
pylint>=1.5.0 # GPLv2

View File

@ -17,11 +17,11 @@ import testtools
from syntribos.extensions.cinder import client
class Content():
class Content(object):
id = 1234
class _FakeVolume():
class _FakeVolume(object):
"""Fake cinder client object."""
def create(*args, **kwargs):
@ -31,7 +31,7 @@ class _FakeVolume():
return []
class _FakeVolumeType():
class _FakeVolumeType(object):
def create(*args, **kwargs):
return Content()
@ -39,7 +39,7 @@ class _FakeVolumeType():
return []
class _FakeSnapshot():
class _FakeSnapshot(object):
def create(*args, **kwargs):
return Content()
@ -47,7 +47,7 @@ class _FakeSnapshot():
return []
class _FakeStorage():
class _FakeStorage(object):
"""Fake storage client."""
volumes = _FakeVolume() # noqa
volume_types = _FakeVolumeType() # noqa

View File

@ -17,12 +17,12 @@ import testtools
from syntribos.extensions.glance import client
class _Image_meta_data():
class _Image_meta_data(object):
def __init__(self):
self.id = 1234
class _Images():
class _Images(object):
def create(self, name):
return _Image_meta_data()
@ -31,7 +31,7 @@ class _Images():
return []
class _FakeGlance():
class _FakeGlance(object):
"""Fake glance client object."""
images = _Images()

View File

@ -22,9 +22,9 @@ from syntribos.utils.config_fixture import ConfFixture
class TestIdentityClient(testtools.TestCase):
"""Tests get_token v2 and v3 methods of the identity client."""
class _FakeRequest():
class _FakeRequest(object):
"""Fake request class used to mock request method of SynHTTPClient."""
class _FakeResponse():
class _FakeResponse(object):
def __init__(self):
self.content = {"access": {"token": {"id": 1234}}}
self.headers = {"X-Subject-Token": 12345}

View File

@ -17,7 +17,7 @@ import testtools
from syntribos.extensions.neutron import client
class _FakeNetwork():
class _FakeNetwork(object):
"""Fake neutron client object."""
def create_network(self, data):

View File

@ -18,11 +18,11 @@ from syntribos.extensions.nova import client
from syntribos.utils.config_fixture import ConfFixture
class Content():
class Content(object):
id = 1234
class _Fakeserver():
class _Fakeserver(object):
"""Fake nova client object."""
def create(*args, **kwargs):
@ -32,12 +32,12 @@ class _Fakeserver():
return []
class _FakeHypervisor():
class _FakeHypervisor(object):
def list(data):
return [Content()]
class _FakeAggregates():
class _FakeAggregates(object):
def create(*args, **kwargs):
return Content()
@ -45,7 +45,7 @@ class _FakeAggregates():
return []
class _FakeStorage():
class _FakeStorage(object):
"""Fake storage client."""
servers = _Fakeserver() # noqa
hypervisors = _FakeHypervisor() # noqa

View File

@ -1,5 +1,5 @@
[tox]
envlist=pep8,py27,py35
envlist=pep8,py27,py37
skipsdist = True
[testenv]
@ -14,6 +14,7 @@ commands =
coverage report -m
[testenv:docs]
basepython = python3
commands =
rm -rf doc/html doc/build
rm -rf doc/source/apidoc doc/source/api
@ -22,11 +23,13 @@ whitelist_externals =
rm
[testenv:pep8]
basepython = python3
commands=flake8 {posargs} syntribos
flake8 {posargs} tests
{[testenv:pylint]commands}
[testenv:venv]
basepython = python3
commands = {posargs}
[flake8]