Use unittest.mock instead of third party mock

Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I26f2df6d4657133a5c7e6ed85298aa843c1bdd73
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-03-31 13:37:26 -05:00
parent 79b3d5bb5a
commit 4d2310b2a9
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
8 changed files with 8 additions and 11 deletions

View File

@ -24,7 +24,6 @@ kombu==4.0.0
linecache2==1.0.0 linecache2==1.0.0
MarkupSafe==1.0 MarkupSafe==1.0
mccabe==0.2.1 mccabe==0.2.1
mock==2.0.0
mox3==0.20.0 mox3==0.20.0
msgpack-python==0.4.0 msgpack-python==0.4.0
netaddr==0.7.18 netaddr==0.7.18

View File

@ -27,10 +27,11 @@ import datetime
import hashlib import hashlib
import inspect import inspect
import logging import logging
import mock from unittest import mock
from oslo_utils import versionutils as vutils
import fixtures import fixtures
from oslo_utils import versionutils as vutils
from oslo_versionedobjects import base from oslo_versionedobjects import base
from oslo_versionedobjects import fields from oslo_versionedobjects import fields

View File

@ -25,8 +25,8 @@ eventlet.monkey_patch(os=False) # noqa
import functools import functools
import inspect import inspect
import mock
import os import os
from unittest import mock
import fixtures import fixtures
from oslo_concurrency import lockutils from oslo_concurrency import lockutils

View File

@ -11,13 +11,11 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from unittest import mock
from oslo_versionedobjects import exception from oslo_versionedobjects import exception
from oslo_versionedobjects import test from oslo_versionedobjects import test
import mock
notifier = mock.Mock() notifier = mock.Mock()

View File

@ -14,10 +14,10 @@
# under the License. # under the License.
import datetime import datetime
from unittest import mock
import warnings import warnings
import iso8601 import iso8601
import mock
import netaddr import netaddr
import testtools import testtools

View File

@ -17,9 +17,9 @@ import copy
import datetime import datetime
import hashlib import hashlib
import inspect import inspect
from unittest import mock
import iso8601 import iso8601
import mock
from oslo_versionedobjects import base from oslo_versionedobjects import base
from oslo_versionedobjects import exception from oslo_versionedobjects import exception

View File

@ -17,8 +17,8 @@ import datetime
import jsonschema import jsonschema
import logging import logging
import pytz import pytz
from unittest import mock
import mock
from oslo_context import context from oslo_context import context
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_utils import timeutils from oslo_utils import timeutils

View File

@ -8,7 +8,6 @@ coverage!=4.4,>=4.0 # Apache-2.0
jsonschema>=2.6.0 # MIT jsonschema>=2.6.0 # MIT
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
mock>=2.0.0 # BSD
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
# Bandit security code scanner # Bandit security code scanner