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: I5587ac8f603798aad27908d3bd6ed8ebb3a9c14e
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-03-31 14:09:06 -05:00
parent 2a47215e36
commit 2aaf7b08a6
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
7 changed files with 11 additions and 10 deletions

View File

@ -22,7 +22,6 @@ keystoneauth1==3.4.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
monotonic==1.4;python_version<'3.3' monotonic==1.4;python_version<'3.3'
mox3==0.25.0 mox3==0.25.0
msgpack==0.5.6 msgpack==0.5.6

View File

@ -14,17 +14,17 @@
"""Unit Tests for oslo.log formatter""" """Unit Tests for oslo.log formatter"""
import mock
import logging import logging
import sys import sys
from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_config import fixture as config_fixture from oslo_config import fixture as config_fixture
from oslo_context import context from oslo_context import context
from oslotest import base as test_base
from oslo_log import formatters from oslo_log import formatters
from oslo_log import log from oslo_log import log
from oslotest import base as test_base
def _fake_context(): def _fake_context():

View File

@ -10,10 +10,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslo_log import helpers
from oslotest import base as test_base from oslotest import base as test_base
from oslo_log import helpers
class LogHelpersTestCase(test_base.BaseTestCase): class LogHelpersTestCase(test_base.BaseTestCase):

View File

@ -31,9 +31,9 @@ except ImportError:
syslog = None syslog = None
import tempfile import tempfile
import time import time
from unittest import mock
from dateutil import tz from dateutil import tz
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_config import fixture as fixture_config # noqa from oslo_config import fixture as fixture_config # noqa
from oslo_context import context from oslo_context import context

View File

@ -14,8 +14,8 @@
import io import io
import logging import logging
from unittest import mock
import mock
from oslotest import base as test_base from oslotest import base as test_base
from oslo_log import rate_limit from oslo_log import rate_limit

View File

@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import mock from unittest import mock
from oslotest import base as test_base from oslotest import base as test_base
from testtools import matchers from testtools import matchers

View File

@ -6,7 +6,6 @@ hacking>=2.0.0,<2.1.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
testtools>=2.3.0 # MIT testtools>=2.3.0 # MIT
mock>=2.0.0 # BSD
oslotest>=3.3.0 # Apache-2.0 oslotest>=3.3.0 # Apache-2.0
coverage>=4.5.1 # Apache-2.0 coverage>=4.5.1 # Apache-2.0