Fix Python 3 functional tests run
Cinderlib functional tests run fine on Python 2, but when run with Python 3.6 we fail to import base_tests from test_basic and we also get a dictionary changed size during iteration error. This patch makes it possible to run functional tests on Python 3 versions. Change-Id: Ib66b29102d58ab1600e206e205a70efa17b978f4
This commit is contained in:
parent
7f61d74337
commit
b74a3f04b3
|
@ -41,7 +41,8 @@ def set_backend(func, new_name, backend_name):
|
|||
def test_all_backends(cls):
|
||||
"""Decorator to run tests in a class for all available backends."""
|
||||
config = BaseFunctTestCase.ensure_config_loaded()
|
||||
for fname, func in cls.__dict__.items():
|
||||
# Prevent dictionary changed size during iteration on Python 3
|
||||
for fname, func in dict(vars(cls)).items():
|
||||
if fname.startswith('test_'):
|
||||
for backend in config['backends']:
|
||||
bname = backend['volume_backend_name']
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
import os
|
||||
|
||||
import base_tests
|
||||
import cinderlib
|
||||
from cinderlib.tests.functional import base_tests
|
||||
|
||||
|
||||
class BaseFunctTestCase(base_tests.unittest2.TestCase):
|
||||
|
|
Loading…
Reference in New Issue