diff --git a/lower-constraints.txt b/lower-constraints.txt index bfadfcb0..2bd229a2 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -22,7 +22,6 @@ linecache2==1.0.0 lxml==3.4.1 MarkupSafe==1.0 mccabe==0.2.1 -mock==2.0.0 netaddr==0.7.18 netifaces==0.10.4 openstackdocstheme==1.20.0 diff --git a/oslo_vmware/tests/objects/test_datacenter.py b/oslo_vmware/tests/objects/test_datacenter.py index c4d261ed..2a346f97 100644 --- a/oslo_vmware/tests/objects/test_datacenter.py +++ b/oslo_vmware/tests/objects/test_datacenter.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from oslo_vmware.objects import datacenter from oslo_vmware.tests import base diff --git a/oslo_vmware/tests/objects/test_datastore.py b/oslo_vmware/tests/objects/test_datastore.py index bda052b4..68cc0ead 100644 --- a/oslo_vmware/tests/objects/test_datastore.py +++ b/oslo_vmware/tests/objects/test_datastore.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock + from oslo_utils import units import urllib.parse as urlparse diff --git a/oslo_vmware/tests/test_api.py b/oslo_vmware/tests/test_api.py index 298aabd8..499436d7 100644 --- a/oslo_vmware/tests/test_api.py +++ b/oslo_vmware/tests/test_api.py @@ -14,16 +14,15 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for session management and API invocation classes. -""" +"""Unit tests for session management and API invocation classes.""" from datetime import datetime +from unittest import mock + from eventlet import greenthread -import mock +from oslo_context import context import suds -from oslo_context import context from oslo_vmware import api from oslo_vmware import exceptions from oslo_vmware import pbm diff --git a/oslo_vmware/tests/test_dvs_util.py b/oslo_vmware/tests/test_dvs_util.py index 1179d46f..8382a401 100644 --- a/oslo_vmware/tests/test_dvs_util.py +++ b/oslo_vmware/tests/test_dvs_util.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for VMware DVS utility module. -""" +"""Unit tests for VMware DVS utility module.""" import collections - -import mock +from unittest import mock from oslo_vmware import dvs_util from oslo_vmware.tests import base diff --git a/oslo_vmware/tests/test_exceptions.py b/oslo_vmware/tests/test_exceptions.py index d70756bd..6c393ad2 100644 --- a/oslo_vmware/tests/test_exceptions.py +++ b/oslo_vmware/tests/test_exceptions.py @@ -13,10 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for exceptions module. -""" -import mock +"""Unit tests for exceptions module.""" +from unittest import mock from oslo_vmware._i18n import _ from oslo_vmware import exceptions diff --git a/oslo_vmware/tests/test_image_transfer.py b/oslo_vmware/tests/test_image_transfer.py index f1ad58b3..b21bedb1 100644 --- a/oslo_vmware/tests/test_image_transfer.py +++ b/oslo_vmware/tests/test_image_transfer.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for functions and classes for image transfer. -""" +"""Unit tests for functions and classes for image transfer.""" import io - -import mock +from unittest import mock from oslo_vmware import exceptions from oslo_vmware import image_transfer diff --git a/oslo_vmware/tests/test_pbm.py b/oslo_vmware/tests/test_pbm.py index 3b57506c..2a3b29f6 100644 --- a/oslo_vmware/tests/test_pbm.py +++ b/oslo_vmware/tests/test_pbm.py @@ -13,13 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for PBM utility methods. -""" +"""Unit tests for PBM utility methods.""" import os +from unittest import mock -import mock import urllib.parse as urlparse import urllib.request as urllib diff --git a/oslo_vmware/tests/test_rw_handles.py b/oslo_vmware/tests/test_rw_handles.py index b35faed9..1301bb78 100644 --- a/oslo_vmware/tests/test_rw_handles.py +++ b/oslo_vmware/tests/test_rw_handles.py @@ -13,13 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for read and write handles for image transfer. -""" +"""Unit tests for read and write handles for image transfer.""" import ssl +from unittest import mock -import mock import requests from oslo_vmware import exceptions diff --git a/oslo_vmware/tests/test_service.py b/oslo_vmware/tests/test_service.py index 20654542..c3cc23f1 100644 --- a/oslo_vmware/tests/test_service.py +++ b/oslo_vmware/tests/test_service.py @@ -15,9 +15,9 @@ import http.client as httplib import io +from unittest import mock import ddt -import mock import requests import suds diff --git a/oslo_vmware/tests/test_vim.py b/oslo_vmware/tests/test_vim.py index ddfa82eb..0887a05a 100644 --- a/oslo_vmware/tests/test_vim.py +++ b/oslo_vmware/tests/test_vim.py @@ -13,13 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for classes to invoke VMware VI SOAP calls. -""" +"""Unit tests for classes to invoke VMware VI SOAP calls.""" import copy +from unittest import mock -import mock from oslo_i18n import fixture as i18n_fixture import suds diff --git a/oslo_vmware/tests/test_vim_util.py b/oslo_vmware/tests/test_vim_util.py index 36d63751..e73bf6e3 100644 --- a/oslo_vmware/tests/test_vim_util.py +++ b/oslo_vmware/tests/test_vim_util.py @@ -13,13 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Unit tests for VMware API utility module. -""" +"""Unit tests for VMware API utility module.""" import collections - -import mock +from unittest import mock from oslo_vmware.tests import base from oslo_vmware import vim_util diff --git a/test-requirements.txt b/test-requirements.txt index 3c8beeb2..65fa4f8f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,6 @@ hacking>=3.0,<3.1.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -mock>=2.0.0 # BSD testtools>=2.2.0 # MIT stestr>=2.0.0 # Apache-2.0