diff --git a/tempest/tests/cmd/test_verify_tempest_config.py b/tempest/tests/cmd/test_verify_tempest_config.py
index 98bf145..640dcd4 100644
--- a/tempest/tests/cmd/test_verify_tempest_config.py
+++ b/tempest/tests/cmd/test_verify_tempest_config.py
@@ -12,9 +12,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import fixtures
 import mock
 from oslo_serialization import jsonutils as json
-from oslotest import mockpatch
 
 from tempest.cmd import verify_tempest_config
 from tempest import config
@@ -73,12 +73,12 @@
                          fake_config.FakePrivate)
 
     def test_get_keystone_api_versions(self):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': {'values': [{'id': 'v2.0'}, {'id': 'v3.0'}]}}
         fake_resp = json.dumps(fake_resp)
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.lib.common.http.ClosingHttp.request',
             return_value=(None, fake_resp)))
         fake_os = mock.MagicMock()
@@ -87,12 +87,12 @@
         self.assertIn('v3.0', versions)
 
     def test_get_cinder_api_versions(self):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': [{'id': 'v1.0'}, {'id': 'v2.0'}]}
         fake_resp = json.dumps(fake_resp)
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.lib.common.http.ClosingHttp.request',
             return_value=(None, fake_resp)))
         fake_os = mock.MagicMock()
@@ -101,12 +101,12 @@
         self.assertIn('v2.0', versions)
 
     def test_get_nova_versions(self):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': [{'id': 'v2.0'}, {'id': 'v3.0'}]}
         fake_resp = json.dumps(fake_resp)
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.lib.common.http.ClosingHttp.request',
             return_value=(None, fake_resp)))
         fake_os = mock.MagicMock()
@@ -117,17 +117,17 @@
     def test_get_versions_invalid_response(self):
         # When the response doesn't contain a JSON response, an error is
         # logged.
-        mock_log_error = self.useFixture(mockpatch.PatchObject(
+        mock_log_error = self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config.LOG, 'error')).mock
 
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint'))
 
         # Simulated response is not JSON.
         sample_body = (
             '<html><head>Sample Response</head><body>This is the sample page '
             'for the web server. Why are you requesting it?</body></html>')
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.lib.common.http.ClosingHttp.request',
             return_value=(None, sample_body)))
 
@@ -157,7 +157,7 @@
 
     @mock.patch('tempest.lib.common.http.ClosingHttp.request')
     def test_verify_keystone_api_versions_no_v3(self, mock_request):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': {'values': [{'id': 'v2.0'}]}}
@@ -173,7 +173,7 @@
 
     @mock.patch('tempest.lib.common.http.ClosingHttp.request')
     def test_verify_keystone_api_versions_no_v2(self, mock_request):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': {'values': [{'id': 'v3.0'}]}}
@@ -189,7 +189,7 @@
 
     @mock.patch('tempest.lib.common.http.ClosingHttp.request')
     def test_verify_cinder_api_versions_no_v3(self, mock_request):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': [{'id': 'v2.0'}]}
@@ -203,7 +203,7 @@
 
     @mock.patch('tempest.lib.common.http.ClosingHttp.request')
     def test_verify_cinder_api_versions_no_v2(self, mock_request):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': [{'id': 'v3.0'}]}
@@ -221,7 +221,7 @@
 
     @mock.patch('tempest.lib.common.http.ClosingHttp.request')
     def test_verify_cinder_api_versions_no_v1(self, mock_request):
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, '_get_unversioned_endpoint',
             return_value='http://fake_endpoint:5000'))
         fake_resp = {'versions': [{'id': 'v2.0'}, {'id': 'v3.0'}]}
@@ -276,7 +276,7 @@
         fake_os = mock.MagicMock()
         fake_os.network_extensions_client.list_extensions = (
             fake_list_extensions)
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['fake1', 'fake2', 'fake3'])))
         results = verify_tempest_config.verify_extensions(fake_os,
@@ -299,7 +299,7 @@
         fake_os = mock.MagicMock()
         fake_os.network_extensions_client.list_extensions = (
             fake_list_extensions)
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['all'])))
         results = verify_tempest_config.verify_extensions(fake_os,
@@ -319,7 +319,7 @@
         fake_os.volumes_extension_client.list_extensions = fake_list_extensions
         fake_os.volumes_v2_extension_client.list_extensions = (
             fake_list_extensions)
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['fake1', 'fake2', 'fake3'])))
         results = verify_tempest_config.verify_extensions(fake_os,
@@ -344,7 +344,7 @@
         fake_os.volumes_extension_client.list_extensions = fake_list_extensions
         fake_os.volumes_v2_extension_client.list_extensions = (
             fake_list_extensions)
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['all'])))
         results = verify_tempest_config.verify_extensions(fake_os,
@@ -360,7 +360,7 @@
                      {'alias': 'not_fake'}])
         fake_os = mock.MagicMock()
         fake_os.extensions_client.list_extensions = fake_list_extensions
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['fake1', 'fake2', 'fake3'])))
         results = verify_tempest_config.verify_extensions(fake_os,
@@ -382,7 +382,7 @@
                                     {'alias': 'not_fake'}]})
         fake_os = mock.MagicMock()
         fake_os.extensions_client.list_extensions = fake_list_extensions
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['all'])))
         results = verify_tempest_config.verify_extensions(fake_os,
@@ -400,7 +400,7 @@
                            'swift': 'metadata'})
         fake_os = mock.MagicMock()
         fake_os.capabilities_client.list_capabilities = fake_list_extensions
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['fake1', 'fake2', 'fake3'])))
         results = verify_tempest_config.verify_extensions(fake_os, 'swift', {})
@@ -422,7 +422,7 @@
                            'swift': 'metadata'})
         fake_os = mock.MagicMock()
         fake_os.capabilities_client.list_capabilities = fake_list_extensions
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             verify_tempest_config, 'get_enabled_extensions',
             return_value=(['all'])))
         results = verify_tempest_config.verify_extensions(fake_os,
diff --git a/tempest/tests/common/test_admin_available.py b/tempest/tests/common/test_admin_available.py
index 01a9cd0..c3d248c 100644
--- a/tempest/tests/common/test_admin_available.py
+++ b/tempest/tests/common/test_admin_available.py
@@ -12,8 +12,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import fixtures
 from oslo_config import cfg
-from oslotest import mockpatch
 
 from tempest.common import credentials_factory as credentials
 from tempest import config
@@ -52,16 +52,16 @@
                                  'project_name': 'admin',
                                  'password': 'p',
                                  'types': ['admin']})
-            self.useFixture(mockpatch.Patch(
+            self.useFixture(fixtures.MockPatch(
                 'tempest.common.preprov_creds.read_accounts_yaml',
                 return_value=accounts))
             cfg.CONF.set_default('test_accounts_file',
                                  use_accounts_file, group='auth')
-            self.useFixture(mockpatch.Patch('os.path.isfile',
-                                            return_value=True))
+            self.useFixture(fixtures.MockPatch('os.path.isfile',
+                                               return_value=True))
         else:
-            self.useFixture(mockpatch.Patch('os.path.isfile',
-                                            return_value=False))
+            self.useFixture(fixtures.MockPatch('os.path.isfile',
+                                               return_value=False))
             if admin_creds:
                 username = 'u'
                 project = 't'
diff --git a/tempest/tests/common/test_alt_available.py b/tempest/tests/common/test_alt_available.py
index 27db95c..b9a8967 100644
--- a/tempest/tests/common/test_alt_available.py
+++ b/tempest/tests/common/test_alt_available.py
@@ -12,8 +12,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import fixtures
 from oslo_config import cfg
-from oslotest import mockpatch
 
 from tempest.common import credentials_factory as credentials
 from tempest import config
@@ -39,16 +39,16 @@
             accounts = [dict(username="u%s" % ii,
                              project_name="t%s" % ii,
                              password="p") for ii in creds]
-            self.useFixture(mockpatch.Patch(
+            self.useFixture(fixtures.MockPatch(
                 'tempest.common.preprov_creds.read_accounts_yaml',
                 return_value=accounts))
             cfg.CONF.set_default('test_accounts_file',
                                  use_accounts_file, group='auth')
-            self.useFixture(mockpatch.Patch('os.path.isfile',
-                                            return_value=True))
+            self.useFixture(fixtures.MockPatch('os.path.isfile',
+                                               return_value=True))
         else:
-            self.useFixture(mockpatch.Patch('os.path.isfile',
-                                            return_value=False))
+            self.useFixture(fixtures.MockPatch('os.path.isfile',
+                                               return_value=False))
         expected = len(set(creds)) > 1 or dynamic_creds
         observed = credentials.is_alt_available(
             identity_version=self.identity_version)
diff --git a/tempest/tests/common/test_dynamic_creds.py b/tempest/tests/common/test_dynamic_creds.py
index b4fbd50..c739619 100644
--- a/tempest/tests/common/test_dynamic_creds.py
+++ b/tempest/tests/common/test_dynamic_creds.py
@@ -12,9 +12,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import fixtures
 import mock
 from oslo_config import cfg
-from oslotest import mockpatch
 
 from tempest.common import credentials_factory as credentials
 from tempest.common import dynamic_creds
@@ -84,7 +84,7 @@
             tenant_name='fake_tenant')
 
     def _mock_user_create(self, id, name):
-        user_fix = self.useFixture(mockpatch.PatchObject(
+        user_fix = self.useFixture(fixtures.MockPatchObject(
             self.users_client.UsersClient,
             'create_user',
             return_value=(rest_client.ResponseBody
@@ -92,7 +92,7 @@
         return user_fix
 
     def _mock_tenant_create(self, id, name):
-        tenant_fix = self.useFixture(mockpatch.PatchObject(
+        tenant_fix = self.useFixture(fixtures.MockPatchObject(
             self.tenants_client.TenantsClient,
             'create_tenant',
             return_value=(rest_client.ResponseBody
@@ -100,7 +100,7 @@
         return tenant_fix
 
     def _mock_list_roles(self, id, name):
-        roles_fix = self.useFixture(mockpatch.PatchObject(
+        roles_fix = self.useFixture(fixtures.MockPatchObject(
             self.roles_client.RolesClient,
             'list_roles',
             return_value=(rest_client.ResponseBody
@@ -111,7 +111,7 @@
         return roles_fix
 
     def _mock_list_2_roles(self):
-        roles_fix = self.useFixture(mockpatch.PatchObject(
+        roles_fix = self.useFixture(fixtures.MockPatchObject(
             self.roles_client.RolesClient,
             'list_roles',
             return_value=(rest_client.ResponseBody
@@ -122,7 +122,7 @@
         return roles_fix
 
     def _mock_assign_user_role(self):
-        tenant_fix = self.useFixture(mockpatch.PatchObject(
+        tenant_fix = self.useFixture(fixtures.MockPatchObject(
             self.roles_client.RolesClient,
             'create_user_role_on_project',
             return_value=(rest_client.ResponseBody
@@ -130,7 +130,7 @@
         return tenant_fix
 
     def _mock_list_role(self):
-        roles_fix = self.useFixture(mockpatch.PatchObject(
+        roles_fix = self.useFixture(fixtures.MockPatchObject(
             self.roles_client.RolesClient,
             'list_roles',
             return_value=(rest_client.ResponseBody
@@ -140,7 +140,7 @@
         return roles_fix
 
     def _mock_list_ec2_credentials(self, user_id, tenant_id):
-        ec2_creds_fix = self.useFixture(mockpatch.PatchObject(
+        ec2_creds_fix = self.useFixture(fixtures.MockPatchObject(
             self.users_client.UsersClient,
             'list_user_ec2_credentials',
             return_value=(rest_client.ResponseBody
@@ -153,21 +153,21 @@
         return ec2_creds_fix
 
     def _mock_network_create(self, iso_creds, id, name):
-        net_fix = self.useFixture(mockpatch.PatchObject(
+        net_fix = self.useFixture(fixtures.MockPatchObject(
             iso_creds.networks_admin_client,
             'create_network',
             return_value={'network': {'id': id, 'name': name}}))
         return net_fix
 
     def _mock_subnet_create(self, iso_creds, id, name):
-        subnet_fix = self.useFixture(mockpatch.PatchObject(
+        subnet_fix = self.useFixture(fixtures.MockPatchObject(
             iso_creds.subnets_admin_client,
             'create_subnet',
             return_value={'subnet': {'id': id, 'name': name}}))
         return subnet_fix
 
     def _mock_router_create(self, id, name):
-        router_fix = self.useFixture(mockpatch.PatchObject(
+        router_fix = self.useFixture(fixtures.MockPatchObject(
             routers_client.RoutersClient,
             'create_router',
             return_value={'router': {'id': id, 'name': name}}))
@@ -634,7 +634,7 @@
     def setUp(self):
         super(TestDynamicCredentialProviderV3, self).setUp()
         self.useFixture(fake_config.ConfigFixture())
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             domains_client.DomainsClient, 'list_domains',
             return_value=dict(domains=[dict(id='default',
                                             name='Default')])))
@@ -645,7 +645,7 @@
         pass
 
     def _mock_tenant_create(self, id, name):
-        project_fix = self.useFixture(mockpatch.PatchObject(
+        project_fix = self.useFixture(fixtures.MockPatchObject(
             self.tenants_client.ProjectsClient,
             'create_project',
             return_value=(rest_client.ResponseBody
diff --git a/tempest/tests/common/test_preprov_creds.py b/tempest/tests/common/test_preprov_creds.py
index 2fd375d..414b106 100644
--- a/tempest/tests/common/test_preprov_creds.py
+++ b/tempest/tests/common/test_preprov_creds.py
@@ -20,9 +20,9 @@
 import six
 import testtools
 
+import fixtures
 from oslo_concurrency.fixture import lockutils as lockutils_fixtures
 from oslo_config import cfg
-from oslotest import mockpatch
 
 from tempest.common import preprov_creds
 from tempest import config
@@ -86,10 +86,11 @@
         self.patch(self.token_client, side_effect=self.identity_response)
         self.useFixture(lockutils_fixtures.ExternalLockFixture())
         self.test_accounts = self._fake_accounts(cfg.CONF.identity.admin_role)
-        self.accounts_mock = self.useFixture(mockpatch.Patch(
+        self.accounts_mock = self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=self.test_accounts))
-        self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
+        self.useFixture(fixtures.MockPatch(
+            'os.path.isfile', return_value=True))
 
     def tearDown(self):
         super(TestPreProvisionedCredentials, self).tearDown()
@@ -138,7 +139,8 @@
 
     def test_create_hash_file_previous_file(self):
         # Emulate the lock existing on the filesystem
-        self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
+        self.useFixture(fixtures.MockPatch(
+            'os.path.isfile', return_value=True))
         with mock.patch('six.moves.builtins.open', mock.mock_open(),
                         create=True):
             test_account_class = (
@@ -150,7 +152,8 @@
 
     def test_create_hash_file_no_previous_file(self):
         # Emulate the lock not existing on the filesystem
-        self.useFixture(mockpatch.Patch('os.path.isfile', return_value=False))
+        self.useFixture(fixtures.MockPatch(
+            'os.path.isfile', return_value=False))
         with mock.patch('six.moves.builtins.open', mock.mock_open(),
                         create=True):
             test_account_class = (
@@ -163,10 +166,12 @@
     @mock.patch('oslo_concurrency.lockutils.lock')
     def test_get_free_hash_no_previous_accounts(self, lock_mock):
         # Emulate no pre-existing lock
-        self.useFixture(mockpatch.Patch('os.path.isdir', return_value=False))
+        self.useFixture(fixtures.MockPatch(
+            'os.path.isdir', return_value=False))
         hash_list = self._get_hash_list(self.test_accounts)
-        mkdir_mock = self.useFixture(mockpatch.Patch('os.mkdir'))
-        self.useFixture(mockpatch.Patch('os.path.isfile', return_value=False))
+        mkdir_mock = self.useFixture(fixtures.MockPatch('os.mkdir'))
+        self.useFixture(fixtures.MockPatch(
+            'os.path.isfile', return_value=False))
         test_account_class = preprov_creds.PreProvisionedCredentialProvider(
             **self.fixed_params)
         with mock.patch('six.moves.builtins.open', mock.mock_open(),
@@ -182,9 +187,10 @@
     def test_get_free_hash_no_free_accounts(self, lock_mock):
         hash_list = self._get_hash_list(self.test_accounts)
         # Emulate pre-existing lock dir
-        self.useFixture(mockpatch.Patch('os.path.isdir', return_value=True))
-        # Emulate all lcoks in list are in use
-        self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
+        self.useFixture(fixtures.MockPatch('os.path.isdir', return_value=True))
+        # Emulate all locks in list are in use
+        self.useFixture(fixtures.MockPatch(
+            'os.path.isfile', return_value=True))
         test_account_class = preprov_creds.PreProvisionedCredentialProvider(
             **self.fixed_params)
         with mock.patch('six.moves.builtins.open', mock.mock_open(),
@@ -195,7 +201,7 @@
     @mock.patch('oslo_concurrency.lockutils.lock')
     def test_get_free_hash_some_in_use_accounts(self, lock_mock):
         # Emulate no pre-existing lock
-        self.useFixture(mockpatch.Patch('os.path.isdir', return_value=True))
+        self.useFixture(fixtures.MockPatch('os.path.isdir', return_value=True))
         hash_list = self._get_hash_list(self.test_accounts)
         test_account_class = preprov_creds.PreProvisionedCredentialProvider(
             **self.fixed_params)
@@ -219,13 +225,14 @@
     def test_remove_hash_last_account(self, lock_mock):
         hash_list = self._get_hash_list(self.test_accounts)
         # Pretend the pseudo-lock is there
-        self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
+        self.useFixture(
+            fixtures.MockPatch('os.path.isfile', return_value=True))
         # Pretend the lock dir is empty
-        self.useFixture(mockpatch.Patch('os.listdir', return_value=[]))
+        self.useFixture(fixtures.MockPatch('os.listdir', return_value=[]))
         test_account_class = preprov_creds.PreProvisionedCredentialProvider(
             **self.fixed_params)
-        remove_mock = self.useFixture(mockpatch.Patch('os.remove'))
-        rmdir_mock = self.useFixture(mockpatch.Patch('os.rmdir'))
+        remove_mock = self.useFixture(fixtures.MockPatch('os.remove'))
+        rmdir_mock = self.useFixture(fixtures.MockPatch('os.rmdir'))
         test_account_class.remove_hash(hash_list[2])
         hash_path = os.path.join(self.fixed_params['accounts_lock_dir'],
                                  hash_list[2])
@@ -237,14 +244,15 @@
     def test_remove_hash_not_last_account(self, lock_mock):
         hash_list = self._get_hash_list(self.test_accounts)
         # Pretend the pseudo-lock is there
-        self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
+        self.useFixture(fixtures.MockPatch(
+            'os.path.isfile', return_value=True))
         # Pretend the lock dir is empty
-        self.useFixture(mockpatch.Patch('os.listdir', return_value=[
+        self.useFixture(fixtures.MockPatch('os.listdir', return_value=[
             hash_list[1], hash_list[4]]))
         test_account_class = preprov_creds.PreProvisionedCredentialProvider(
             **self.fixed_params)
-        remove_mock = self.useFixture(mockpatch.Patch('os.remove'))
-        rmdir_mock = self.useFixture(mockpatch.Patch('os.rmdir'))
+        remove_mock = self.useFixture(fixtures.MockPatch('os.remove'))
+        rmdir_mock = self.useFixture(fixtures.MockPatch('os.rmdir'))
         test_account_class.remove_hash(hash_list[2])
         hash_path = os.path.join(self.fixed_params['accounts_lock_dir'],
                                  hash_list[2])
@@ -258,7 +266,7 @@
 
     def test_is_not_multi_user(self):
         self.test_accounts = [self.test_accounts[0]]
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=self.test_accounts))
         test_accounts_class = preprov_creds.PreProvisionedCredentialProvider(
@@ -270,7 +278,7 @@
             **self.fixed_params)
         hashes = test_accounts_class.hash_dict['roles']['role4']
         temp_hash = hashes[0]
-        get_free_hash_mock = self.useFixture(mockpatch.PatchObject(
+        get_free_hash_mock = self.useFixture(fixtures.MockPatchObject(
             test_accounts_class, '_get_free_hash', return_value=temp_hash))
         # Test a single role returns all matching roles
         test_accounts_class._get_creds(roles=['role4'])
@@ -287,7 +295,7 @@
         hashes2 = test_accounts_class.hash_dict['roles']['role2']
         hashes = list(set(hashes) & set(hashes2))
         temp_hash = hashes[0]
-        get_free_hash_mock = self.useFixture(mockpatch.PatchObject(
+        get_free_hash_mock = self.useFixture(fixtures.MockPatchObject(
             test_accounts_class, '_get_free_hash', return_value=temp_hash))
         # Test an intersection of multiple roles
         test_accounts_class._get_creds(roles=['role2', 'role4'])
@@ -304,7 +312,7 @@
         admin_hashes = test_accounts_class.hash_dict['roles'][
             cfg.CONF.identity.admin_role]
         temp_hash = hashes[0]
-        get_free_hash_mock = self.useFixture(mockpatch.PatchObject(
+        get_free_hash_mock = self.useFixture(fixtures.MockPatchObject(
             test_accounts_class, '_get_free_hash', return_value=temp_hash))
         # Test an intersection of multiple roles
         test_accounts_class._get_creds()
@@ -322,7 +330,7 @@
             {'username': 'test_user14', 'tenant_name': 'test_tenant14',
              'password': 'p', 'roles': ['role-7', 'role-11'],
              'resources': {'network': 'network-2'}}]
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=test_accounts))
         test_accounts_class = preprov_creds.PreProvisionedCredentialProvider(
@@ -350,7 +358,7 @@
     def test_get_primary_creds_none_available(self):
         admin_accounts = [x for x in self.test_accounts if 'test_admin'
                           in x['username']]
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=admin_accounts))
         test_accounts_class = preprov_creds.PreProvisionedCredentialProvider(
@@ -368,7 +376,7 @@
     def test_get_alt_creds_none_available(self):
         admin_accounts = [x for x in self.test_accounts if 'test_admin'
                           in x['username']]
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=admin_accounts))
         test_accounts_class = preprov_creds.PreProvisionedCredentialProvider(
@@ -389,7 +397,7 @@
              'password': 'p', 'roles': ['role1', 'role2', 'role3', 'role4']},
             {'username': 'test_admin1', 'tenant_name': 'test_tenant11',
              'password': 'p', 'types': ['admin']}]
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=test_accounts))
         test_accounts_class = preprov_creds.PreProvisionedCredentialProvider(
@@ -403,7 +411,7 @@
              'password': 'p', 'roles': ['role1', 'role2', 'role3', 'role4']},
             {'username': 'test_admin1', 'tenant_name': 'test_tenant11',
              'password': 'p', 'roles': [cfg.CONF.identity.admin_role]}]
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=test_accounts))
         test_accounts_class = preprov_creds.PreProvisionedCredentialProvider(
@@ -414,7 +422,7 @@
     def test_get_admin_creds_none_available(self):
         non_admin_accounts = [x for x in self.test_accounts if 'test_admin'
                               not in x['username']]
-        self.useFixture(mockpatch.Patch(
+        self.useFixture(fixtures.MockPatch(
             'tempest.common.preprov_creds.read_accounts_yaml',
             return_value=non_admin_accounts))
         test_accounts_class = preprov_creds.PreProvisionedCredentialProvider(
diff --git a/tempest/tests/common/utils/linux/test_remote_client.py b/tempest/tests/common/utils/linux/test_remote_client.py
index ecb8e64..739357b 100644
--- a/tempest/tests/common/utils/linux/test_remote_client.py
+++ b/tempest/tests/common/utils/linux/test_remote_client.py
@@ -16,7 +16,6 @@
 
 import fixtures
 from oslo_config import cfg
-from oslotest import mockpatch
 
 from tempest.common.utils.linux import remote_client
 from tempest import config
@@ -64,8 +63,8 @@
         cfg.CONF.set_default('connect_timeout', 1, group='validation')
 
         self.conn = remote_client.RemoteClient('127.0.0.1', 'user', 'pass')
-        self.ssh_mock = self.useFixture(mockpatch.PatchObject(self.conn,
-                                                              'ssh_client'))
+        self.ssh_mock = self.useFixture(fixtures.MockPatchObject(self.conn,
+                                                                 'ssh_client'))
 
     def test_write_to_console_regular_str(self):
         self.conn.write_to_console('test')
@@ -111,7 +110,7 @@
         booted_at = 10000
         uptime_sec = 5000.02
         self.ssh_mock.mock.exec_command.return_value = uptime_sec
-        self.useFixture(mockpatch.PatchObject(
+        self.useFixture(fixtures.MockPatchObject(
             time, 'time', return_value=booted_at + uptime_sec))
         self.assertEqual(self.conn.get_boot_time(),
                          time.localtime(booted_at))
diff --git a/tempest/tests/lib/test_auth.py b/tempest/tests/lib/test_auth.py
index ac13a13..c3a792f 100644
--- a/tempest/tests/lib/test_auth.py
+++ b/tempest/tests/lib/test_auth.py
@@ -16,7 +16,7 @@
 import copy
 import datetime
 
-from oslotest import mockpatch
+import fixtures
 import testtools
 
 from tempest.lib import auth
@@ -82,9 +82,9 @@
 
     def test_auth_data_property_when_cache_exists(self):
         self.auth_provider.cache = 'foo'
-        self.useFixture(mockpatch.PatchObject(self.auth_provider,
-                                              'is_expired',
-                                              return_value=False))
+        self.useFixture(fixtures.MockPatchObject(self.auth_provider,
+                                                 'is_expired',
+                                                 return_value=False))
         self.assertEqual('foo', getattr(self.auth_provider, 'auth_data'))
 
     def test_delete_auth_data_property_through_deleter(self):
diff --git a/tempest/tests/lib/test_rest_client.py b/tempest/tests/lib/test_rest_client.py
index 43bb6d0..ace2b80 100644
--- a/tempest/tests/lib/test_rest_client.py
+++ b/tempest/tests/lib/test_rest_client.py
@@ -15,8 +15,8 @@
 import copy
 import json
 
+import fixtures
 import jsonschema
-from oslotest import mockpatch
 import six
 
 from tempest.lib.common import http
@@ -38,16 +38,16 @@
         self.rest_client = rest_client.RestClient(
             self.fake_auth_provider, None, None)
         self.patchobject(http.ClosingHttp, 'request', self.fake_http.request)
-        self.useFixture(mockpatch.PatchObject(self.rest_client,
-                                              '_log_request'))
+        self.useFixture(fixtures.MockPatchObject(self.rest_client,
+                                                 '_log_request'))
 
 
 class TestRestClientHTTPMethods(BaseRestClientTestClass):
     def setUp(self):
         self.fake_http = fake_http.fake_httplib2()
         super(TestRestClientHTTPMethods, self).setUp()
-        self.useFixture(mockpatch.PatchObject(self.rest_client,
-                                              '_error_checker'))
+        self.useFixture(fixtures.MockPatchObject(self.rest_client,
+                                                 '_error_checker'))
 
     def test_post(self):
         __, return_dict = self.rest_client.post(self.url, {}, {})
@@ -70,8 +70,8 @@
         self.assertEqual('PUT', return_dict['method'])
 
     def test_head(self):
-        self.useFixture(mockpatch.PatchObject(self.rest_client,
-                                              'response_checker'))
+        self.useFixture(fixtures.MockPatchObject(self.rest_client,
+                                                 'response_checker'))
         __, return_dict = self.rest_client.head(self.url)
         self.assertEqual('HEAD', return_dict['method'])
 
@@ -122,8 +122,8 @@
         self._verify_headers(resp)
 
     def test_head(self):
-        self.useFixture(mockpatch.PatchObject(self.rest_client,
-                                              'response_checker'))
+        self.useFixture(fixtures.MockPatchObject(self.rest_client,
+                                                 'response_checker'))
         resp, __ = self.rest_client.head(self.url)
         self._verify_headers(resp)
 
@@ -136,8 +136,8 @@
     def setUp(self):
         self.fake_http = fake_http.fake_httplib2()
         super(TestRestClientUpdateHeaders, self).setUp()
-        self.useFixture(mockpatch.PatchObject(self.rest_client,
-                                              '_error_checker'))
+        self.useFixture(fixtures.MockPatchObject(self.rest_client,
+                                                 '_error_checker'))
         self.headers = {'X-Configuration-Session': 'session_id'}
 
     def test_post_update_headers(self):
@@ -201,8 +201,8 @@
         )
 
     def test_head_update_headers(self):
-        self.useFixture(mockpatch.PatchObject(self.rest_client,
-                                              'response_checker'))
+        self.useFixture(fixtures.MockPatchObject(self.rest_client,
+                                                 'response_checker'))
 
         __, return_dict = self.rest_client.head(self.url,
                                                 extra_headers=True,
@@ -1145,8 +1145,8 @@
     }
 
     def test_current_json_schema_validator_version(self):
-        with mockpatch.PatchObject(jsonschema.Draft4Validator,
-                                   "check_schema") as chk_schema:
+        with fixtures.MockPatchObject(jsonschema.Draft4Validator,
+                                      "check_schema") as chk_schema:
             body = {'foo': 'test'}
             self._test_validate_pass(self.schema, body)
             chk_schema.mock.assert_called_once_with(
diff --git a/tempest/tests/test_decorators.py b/tempest/tests/test_decorators.py
index 8b6472b..2fc84dc 100644
--- a/tempest/tests/test_decorators.py
+++ b/tempest/tests/test_decorators.py
@@ -12,8 +12,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import fixtures
 from oslo_config import cfg
-from oslotest import mockpatch
 import testtools
 
 from tempest import config
@@ -95,8 +95,8 @@
                           'bad_service')
 
     def test_services_decorator_with_service_valid_and_unavailable(self):
-        self.useFixture(mockpatch.PatchObject(test.CONF.service_available,
-                                              'cinder', False))
+        self.useFixture(fixtures.MockPatchObject(test.CONF.service_available,
+                                                 'cinder', False))
         self.assertRaises(testtools.TestCase.skipException,
                           self._test_services_helper, 'compute',
                           'volume')
