Use unittest.mock instead of mock

The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: I045079282b1b734639cebf6e7d32c878b3e12b4c
This commit is contained in:
Hervé Beraud 2020-06-09 10:49:36 +02:00
parent 376d9493e2
commit f0ff183586
33 changed files with 31 additions and 33 deletions

View File

@ -59,7 +59,6 @@ Mako==1.0.7
MarkupSafe==1.0
mccabe==0.2.1
microversion-parse==0.2.1
mock==2.0.0
monotonic==1.4
mox3==0.20.0
msgpack==0.5.6

View File

@ -15,7 +15,7 @@
# under the License.
import fixtures
import mock
from unittest import mock
from nova import test
from pypowervm import const as pvm_const

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import fixtures
import mock
from unittest import mock
from nova import test
from pypowervm.wrappers import storage as pvm_stor

View File

@ -15,7 +15,7 @@
# under the License.
import fixtures
import mock
from unittest import mock
from nova import exception as nova_exc
from nova import test

View File

@ -16,7 +16,7 @@
import fixtures
import mock
from unittest import mock
from nova.objects import image_meta
from nova import test

View File

@ -18,7 +18,7 @@
from __future__ import absolute_import
import fixtures
import mock
from unittest import mock
from nova.virt.powervm_ext import driver

View File

@ -15,7 +15,7 @@
# under the License.
import fixtures
import mock
from unittest import mock
from nova import test
from pypowervm import exceptions as pvm_exc
import time

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova import test
from requests.exceptions import RequestException
from swiftclient import exceptions as swft_exc

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova import test

View File

@ -16,7 +16,7 @@
import copy
import eventlet
import mock
from unittest import mock
from nova import exception
from nova import objects

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova import test

View File

@ -15,7 +15,7 @@
# under the License.
import fixtures
import mock
from unittest import mock
from nova import test

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova.compute import task_states
from nova import exception

View File

@ -20,7 +20,7 @@ import contextlib
import logging
import fixtures
import mock
from unittest import mock
from nova import block_device as nova_block_device
from nova.compute import provider_tree
from nova.compute import task_states

View File

@ -15,7 +15,7 @@
# under the License.
#
import mock
from unittest import mock
from nova.compute import power_state
from nova import exception
from nova import test

View File

@ -15,7 +15,7 @@
# under the License.
#
import mock
from unittest import mock
import logging
from nova import test

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import six
from nova import test

View File

@ -18,7 +18,7 @@
from __future__ import absolute_import
import fixtures
import mock
from unittest import mock
from nova import exception
from nova import objects

View File

@ -17,7 +17,7 @@
from __future__ import absolute_import
import fixtures
import mock
from unittest import mock
from nova import test
from oslo_utils.fixture import uuidsentinel
from pypowervm import const as pvm_const

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import retrying
from nova import exception

View File

@ -15,7 +15,7 @@
# under the License.
#
import mock
from unittest import mock
from nova import test
from nova_powervm.virt.powervm import exception as p_exc

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova import exception
from nova.network import model

View File

@ -18,7 +18,7 @@ from __future__ import absolute_import
import fixtures
import logging
import mock
from unittest import mock
from nova.compute import power_state
from nova.compute import task_states

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
import six
from nova import test

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova_powervm.tests.virt.powervm.volume import test_driver as test_vol
from nova_powervm.virt.powervm import exception as p_exc

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova_powervm.tests.virt.powervm.volume import test_driver as test_vol
from nova_powervm.virt.powervm.volume import gpfs as v_drv

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova import exception as nova_exc

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova_powervm.tests.virt.powervm.volume import test_driver as test_vol
from nova_powervm.virt.powervm.volume import local as v_drv

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova_powervm.tests.virt.powervm.volume import test_driver as test_vol
from nova_powervm.virt.powervm.volume import nfs as v_drv

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova.compute import task_states
from oslo_serialization import jsonutils

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova_powervm.tests.virt.powervm.volume import test_driver as test_vol
from nova_powervm.virt.powervm import exception as p_exc

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import mock
from unittest import mock
from nova_powervm import conf as cfg
from nova_powervm.tests.virt.powervm.volume import test_driver as test_vol

View File

@ -11,5 +11,4 @@ sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
mock>=2.0.0 # BSD
pycodestyle>=2.0.0 # MIT License