diff --git a/ironicclient/tests/unit/common/apiclient/test_base.py b/ironicclient/tests/unit/common/apiclient/test_base.py index 9e2d6dfc0..89651a4db 100644 --- a/ironicclient/tests/unit/common/apiclient/test_base.py +++ b/ironicclient/tests/unit/common/apiclient/test_base.py @@ -13,7 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslotest import base as test_base from ironicclient.common.apiclient import base diff --git a/ironicclient/tests/unit/common/test_base.py b/ironicclient/tests/unit/common/test_base.py index 0f59ddf31..8a98da88d 100644 --- a/ironicclient/tests/unit/common/test_base.py +++ b/ironicclient/tests/unit/common/test_base.py @@ -14,8 +14,8 @@ # under the License. import copy +from unittest import mock -import mock import testtools from ironicclient.common import base diff --git a/ironicclient/tests/unit/common/test_filecache.py b/ironicclient/tests/unit/common/test_filecache.py index edee043dd..8e179f37b 100644 --- a/ironicclient/tests/unit/common/test_filecache.py +++ b/ironicclient/tests/unit/common/test_filecache.py @@ -11,9 +11,9 @@ # under the License. import os +from unittest import mock import dogpile.cache -import mock from ironicclient.common import filecache from ironicclient.tests.unit import utils diff --git a/ironicclient/tests/unit/common/test_http.py b/ironicclient/tests/unit/common/test_http.py index 5b5e77489..0a7abd3d4 100644 --- a/ironicclient/tests/unit/common/test_http.py +++ b/ironicclient/tests/unit/common/test_http.py @@ -15,9 +15,9 @@ from http import client as http_client import time +from unittest import mock from keystoneauth1 import exceptions as kexc -import mock from oslo_serialization import jsonutils from ironicclient.common import filecache diff --git a/ironicclient/tests/unit/common/test_utils.py b/ironicclient/tests/unit/common/test_utils.py index c60ec3178..d01818f72 100644 --- a/ironicclient/tests/unit/common/test_utils.py +++ b/ironicclient/tests/unit/common/test_utils.py @@ -19,8 +19,8 @@ import os import subprocess import sys import tempfile +from unittest import mock -import mock from ironicclient.common import utils from ironicclient import exc diff --git a/ironicclient/tests/unit/osc/test_plugin.py b/ironicclient/tests/unit/osc/test_plugin.py index 728c7f83d..2167c6dac 100644 --- a/ironicclient/tests/unit/osc/test_plugin.py +++ b/ironicclient/tests/unit/osc/test_plugin.py @@ -11,8 +11,8 @@ # under the License. import argparse +from unittest import mock -import mock import testtools from ironicclient.osc import plugin diff --git a/ironicclient/tests/unit/osc/v1/fakes.py b/ironicclient/tests/unit/osc/v1/fakes.py index b226c543f..f506943b5 100644 --- a/ironicclient/tests/unit/osc/v1/fakes.py +++ b/ironicclient/tests/unit/osc/v1/fakes.py @@ -15,8 +15,8 @@ # import json +from unittest import mock -import mock from osc_lib.tests import utils from ironicclient.tests.unit.osc import fakes diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_allocation.py b/ironicclient/tests/unit/osc/v1/test_baremetal_allocation.py index 56a3c7f4d..391f00932 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_allocation.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_allocation.py @@ -12,8 +12,8 @@ # import copy +from unittest import mock -import mock from osc_lib.tests import utils as osctestutils from ironicclient import exc diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py b/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py index 94fa03a47..9af485326 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_chassis.py @@ -15,8 +15,8 @@ # import copy +from unittest import mock -import mock from osc_lib.tests import utils as oscutils from ironicclient import exc diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_create.py b/ironicclient/tests/unit/osc/v1/test_baremetal_create.py index 69da2e2ae..2f5bd9df9 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_create.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_create.py @@ -11,7 +11,8 @@ # under the License. # -import mock +from unittest import mock + from osc_lib.tests import utils as oscutils from ironicclient.osc.v1 import baremetal_create diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_deploy_template.py b/ironicclient/tests/unit/osc/v1/test_baremetal_deploy_template.py index 799ce1de9..cb9e6e07e 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_deploy_template.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_deploy_template.py @@ -13,8 +13,8 @@ import copy import json +from unittest import mock -import mock from osc_lib.tests import utils as osctestutils from ironicclient import exc diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_node.py b/ironicclient/tests/unit/osc/v1/test_baremetal_node.py index ee16a76a8..dbca38a34 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_node.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_node.py @@ -15,8 +15,8 @@ # import copy +from unittest import mock -import mock from osc_lib.tests import utils as oscutils from ironicclient.common import utils as commonutils diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_port.py b/ironicclient/tests/unit/osc/v1/test_baremetal_port.py index 3c0479c88..2b8fde49a 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_port.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_port.py @@ -15,8 +15,8 @@ # import copy +from unittest import mock -import mock from osc_lib.tests import utils as osctestutils from osc_lib import utils as oscutils diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_portgroup.py b/ironicclient/tests/unit/osc/v1/test_baremetal_portgroup.py index 2d4b67f3a..b8cabce1f 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_portgroup.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_portgroup.py @@ -15,8 +15,8 @@ # import copy +from unittest import mock -import mock from osc_lib.tests import utils as osctestutils from ironicclient.osc.v1 import baremetal_portgroup diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_volume_connector.py b/ironicclient/tests/unit/osc/v1/test_baremetal_volume_connector.py index a39ad6f96..24081b5f3 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_volume_connector.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_volume_connector.py @@ -13,8 +13,8 @@ # under the License. import copy +from unittest import mock -import mock from osc_lib.tests import utils as osctestutils from ironicclient import exc diff --git a/ironicclient/tests/unit/osc/v1/test_baremetal_volume_target.py b/ironicclient/tests/unit/osc/v1/test_baremetal_volume_target.py index 96cbca65f..c472a978e 100644 --- a/ironicclient/tests/unit/osc/v1/test_baremetal_volume_target.py +++ b/ironicclient/tests/unit/osc/v1/test_baremetal_volume_target.py @@ -13,8 +13,8 @@ # under the License. import copy +from unittest import mock -import mock from osc_lib.tests import utils as osctestutils from ironicclient import exc diff --git a/ironicclient/tests/unit/test_client.py b/ironicclient/tests/unit/test_client.py index 2b9f377ce..0b59422bf 100644 --- a/ironicclient/tests/unit/test_client.py +++ b/ironicclient/tests/unit/test_client.py @@ -10,7 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from openstack import config from ironicclient import client as iroclient diff --git a/ironicclient/tests/unit/test_exc.py b/ironicclient/tests/unit/test_exc.py index ea57098d3..b33051ae5 100644 --- a/ironicclient/tests/unit/test_exc.py +++ b/ironicclient/tests/unit/test_exc.py @@ -14,8 +14,8 @@ # under the License. from http import client as http_client +from unittest import mock -import mock from ironicclient.common.apiclient import exceptions from ironicclient import exc diff --git a/ironicclient/tests/unit/utils.py b/ironicclient/tests/unit/utils.py index 02a8767d8..3753a2c17 100644 --- a/ironicclient/tests/unit/utils.py +++ b/ironicclient/tests/unit/utils.py @@ -16,9 +16,9 @@ import copy import io import os +from unittest import mock import fixtures -import mock from oslo_utils import strutils import requests import testtools diff --git a/ironicclient/tests/unit/v1/test_allocation.py b/ironicclient/tests/unit/v1/test_allocation.py index c80f2ad33..f592cdc38 100644 --- a/ironicclient/tests/unit/v1/test_allocation.py +++ b/ironicclient/tests/unit/v1/test_allocation.py @@ -11,8 +11,8 @@ # under the License. import copy +from unittest import mock -import mock import testtools from ironicclient import exc diff --git a/ironicclient/tests/unit/v1/test_client.py b/ironicclient/tests/unit/v1/test_client.py index e765cf7f6..a98f7dad6 100644 --- a/ironicclient/tests/unit/v1/test_client.py +++ b/ironicclient/tests/unit/v1/test_client.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from ironicclient.common import filecache from ironicclient.common import http diff --git a/ironicclient/tests/unit/v1/test_create_resources.py b/ironicclient/tests/unit/v1/test_create_resources.py index c12af70a4..e1b6fab4c 100644 --- a/ironicclient/tests/unit/v1/test_create_resources.py +++ b/ironicclient/tests/unit/v1/test_create_resources.py @@ -11,9 +11,9 @@ # under the License. import builtins +from unittest import mock import jsonschema -import mock from ironicclient import exc from ironicclient.tests.unit import utils diff --git a/ironicclient/tests/unit/v1/test_driver.py b/ironicclient/tests/unit/v1/test_driver.py index 8ef102360..b3f94f51a 100644 --- a/ironicclient/tests/unit/v1/test_driver.py +++ b/ironicclient/tests/unit/v1/test_driver.py @@ -13,7 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + import testtools from testtools import matchers diff --git a/ironicclient/tests/unit/v1/test_node.py b/ironicclient/tests/unit/v1/test_node.py index 873b986bd..ade4f47e4 100644 --- a/ironicclient/tests/unit/v1/test_node.py +++ b/ironicclient/tests/unit/v1/test_node.py @@ -15,8 +15,8 @@ import copy import tempfile import time +from unittest import mock -import mock import testtools from testtools.matchers import HasLength diff --git a/test-requirements.txt b/test-requirements.txt index c31e982dd..3d4cbaa0a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,6 @@ doc8>=0.6.0 # Apache-2.0 flake8-import-order>=0.17.1 # LGPLv3 fixtures>=3.0.0 # Apache-2.0/BSD requests-mock>=1.2.0 # Apache-2.0 -mock>=2.0.0 # BSD Babel!=2.4.0,>=2.3.4 # BSD oslotest>=3.2.0 # Apache-2.0 testtools>=2.2.0 # MIT