Enable python3.5 testing.

This patch enables py35 venv in tox.ini and fixes failing
unit tests.

Change-Id: I1e56056e109a1b4838cd94bccce28199c71f17fd
This commit is contained in:
Alexander Bashmakov 2016-12-13 22:04:21 +00:00
parent 7d364aebd8
commit 88c038b043
3 changed files with 8 additions and 10 deletions

View File

@ -39,13 +39,13 @@ class GlanceExceptionTestCase(test_utils.BaseTestCase):
class FakeGlanceException(exception.GlanceException):
message = "default message: %(code)s"
exc = FakeGlanceException(code=http.INTERNAL_SERVER_ERROR)
exc = FakeGlanceException(code=int(http.INTERNAL_SERVER_ERROR))
self.assertEqual("default message: 500",
encodeutils.exception_to_unicode(exc))
def test_specified_error_msg_with_kwargs(self):
msg = exception.GlanceException('test: %(code)s',
code=http.INTERNAL_SERVER_ERROR)
code=int(http.INTERNAL_SERVER_ERROR))
self.assertIn('test: 500', encodeutils.exception_to_unicode(msg))
def test_non_unicode_error_msg(self):

View File

@ -833,7 +833,7 @@ class TestGlanceAPI(base.IsolatedUnitTest):
self.assertEqual(http_client.REQUEST_ENTITY_TOO_LARGE, res.status_int)
def test_add_image_size_data_exceed_quota(self):
quota = http_client.INTERNAL_SERVER_ERROR
quota = 500
self.config(user_storage_quota=str(quota))
fixture_headers = {
'x-image-meta-name': 'fake image #3',

12
tox.ini
View File

@ -1,14 +1,12 @@
[tox]
minversion = 2.3.1
envlist = py34,py27,pep8
envlist = py35,py27,pep8
skipsdist = True
[testenv]
basepython =
python2.7
debug-py27: python2.7
py34: python3.4
debug-py34: python3.4
{py27,debug-py27,debug,venv,cover,docs,bandit,pep8,api-ref,genconfig,releasenotes}: python2.7
{py35,debug-py35}: python3.5
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
@ -19,7 +17,7 @@ commands =
bandit: bandit -c bandit.yaml -r glance -n5 -p gate
cover: python setup.py testr --coverage --testr-args='^(?!.*test.*coverage).*$'
debug: oslo_debug_helper {posargs}
debug{-py27,-py34}: oslo_debug_helper {posargs}
debug{-py27,-py35}: oslo_debug_helper {posargs}
docs: python setup.py build_sphinx
py27: ostestr --slowest {posargs}
releasenotes: sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
@ -27,7 +25,7 @@ commands =
whitelist_externals = bash
passenv = *_proxy *_PROXY
[testenv:py34]
[testenv:py35]
commands =
lockutils-wrapper python setup.py testr --slowest --testr-args='glance.tests.unit'
python -m testtools.run \