summaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/tempest/test_tempest.py
diff options
context:
space:
mode:
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'