summaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/tempest/test_tempest.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-06-14 20:51:41 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-07-27 14:31:36 +0200
commita321d59c36f368a3a1aeefaa09c9e66b1e8c13c0 (patch)
treeb186e9a1d417d4c73ee135aa4a5688a4689f73d2 /functest/tests/unit/openstack/tempest/test_tempest.py
parentcbf303ec56a1e59d87cf15ba98c6626fa6a03c03 (diff)
Add py3 support in tempest and rally
Change-Id: I009d38a0db409ab4ec641cba9173ab2386d0ce2a Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 09d6e6feef33fa47bca440a096894b851b1ebca5)
Diffstat (limited to 'functest/tests/unit/openstack/tempest/test_tempest.py')
-rw-r--r--functest/tests/unit/openstack/tempest/test_tempest.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py
index 8db21ff3f..1493c2a35 100644
--- a/functest/tests/unit/openstack/tempest/test_tempest.py
+++ b/functest/tests/unit/openstack/tempest/test_tempest.py
@@ -112,7 +112,8 @@ class OSTempestTesting(unittest.TestCase):
@mock.patch("os.remove")
@mock.patch("os.path.exists", return_value=True)
def test_apply_missing_blacklist(self, *args):
- with mock.patch('__builtin__.open', mock.mock_open()) as mock_open, \
+ with mock.patch('six.moves.builtins.open',
+ mock.mock_open()) as mock_open, \
mock.patch.object(self.tempestcommon, 'read_file',
return_value=['test1', 'test2']):
conf_utils.TEMPEST_BLACKLIST = Exception
@@ -134,7 +135,8 @@ class OSTempestTesting(unittest.TestCase):
item_dict = {'scenarios': ['deploy_scenario'],
'installers': ['installer_type'],
'tests': ['test2']}
- with mock.patch('__builtin__.open', mock.mock_open()) as mock_open, \
+ with mock.patch('six.moves.builtins.open',
+ mock.mock_open()) as mock_open, \
mock.patch.object(self.tempestcommon, 'read_file',
return_value=['test1', 'test2']), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
@@ -152,8 +154,9 @@ class OSTempestTesting(unittest.TestCase):
@mock.patch('functest.opnfv_tests.openstack.tempest.tempest.LOGGER.info')
def test_run_verifier_tests_default(self, mock_logger_info):
- with mock.patch('__builtin__.open', mock.mock_open()), \
- mock.patch('__builtin__.iter', return_value=[r'\} tempest\.']), \
+ with mock.patch('six.moves.builtins.open', mock.mock_open()), \
+ mock.patch('six.moves.builtins.iter',
+ return_value=[r'\} tempest\.']), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'subprocess.Popen'):
conf_utils.TEMPEST_LIST = 'test_tempest_list'