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: I3e1e5ed4e72837d45b78e5ccb9ce8cca416e5c11
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-03-31 13:47:04 -05:00
parent 4e6fe7cf7d
commit b903d4e1ee
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
15 changed files with 14 additions and 17 deletions

View File

@ -23,7 +23,6 @@ linecache2==1.0.0
Mako==0.4.0 Mako==0.4.0
MarkupSafe==1.0 MarkupSafe==1.0
mccabe==0.2.1 mccabe==0.2.1
mock==2.0.0
monotonic==0.6 monotonic==0.6
netaddr==0.7.18 netaddr==0.7.18
netifaces==0.10.4 netifaces==0.10.4

View File

@ -16,9 +16,9 @@ import copy
import fixtures import fixtures
import pickle import pickle
import sys import sys
from unittest import mock
import warnings import warnings
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_context import context as oslo_context from oslo_context import context as oslo_context
from oslotest import base as oslo_test_base from oslotest import base as oslo_test_base

View File

@ -16,8 +16,8 @@
import contextlib import contextlib
import itertools import itertools
from unittest import mock
import mock
from oslotest import base as oslo_test_base from oslotest import base as oslo_test_base
import sqlalchemy as sqla import sqlalchemy as sqla
from sqlalchemy.engine import url as sqla_url from sqlalchemy.engine import url as sqla_url

View File

@ -10,11 +10,11 @@
# 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
import os import os
import testresources import testresources
import testscenarios import testscenarios
import unittest import unittest
from unittest import mock
from oslo_db import exception from oslo_db import exception
from oslo_db.sqlalchemy import enginefacade from oslo_db.sqlalchemy import enginefacade

View File

@ -9,9 +9,9 @@
# 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
import alembic import alembic
import mock
from oslotest import base as test_base from oslotest import base as test_base
import sqlalchemy import sqlalchemy

View File

@ -16,10 +16,10 @@
import os import os
import tempfile import tempfile
from unittest import mock
from migrate import exceptions as migrate_exception from migrate import exceptions as migrate_exception
from migrate.versioning import api as versioning_api from migrate.versioning import api as versioning_api
import mock
import sqlalchemy import sqlalchemy
from oslo_db import exception as db_exception from oslo_db import exception as db_exception

View File

@ -13,10 +13,10 @@
# 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
import fixtures import fixtures
from migrate.versioning import api as versioning_api from migrate.versioning import api as versioning_api
import mock
from oslotest import base as test from oslotest import base as test
import sqlalchemy as sa import sqlalchemy as sa
import sqlalchemy.ext.declarative as sa_decl import sqlalchemy.ext.declarative as sa_decl

View File

@ -15,8 +15,8 @@
from collections import abc from collections import abc
import datetime import datetime
from unittest import mock
import mock
from oslotest import base as oslo_test from oslotest import base as oslo_test
from sqlalchemy import Column from sqlalchemy import Column
from sqlalchemy import Integer, String from sqlalchemy import Integer, String

View File

@ -14,8 +14,7 @@
"""Tests for MySQL Cluster (NDB) Support.""" """Tests for MySQL Cluster (NDB) Support."""
import logging import logging
from unittest import mock
import mock
from oslo_db import exception from oslo_db import exception
from oslo_db.sqlalchemy import enginefacade from oslo_db.sqlalchemy import enginefacade

View File

@ -10,8 +10,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
import os import os
from unittest import mock
from oslotest import base as oslo_test_base from oslotest import base as oslo_test_base
from sqlalchemy import exc as sa_exc from sqlalchemy import exc as sa_exc

View File

@ -19,9 +19,9 @@
import logging import logging
import os import os
from unittest import mock
import fixtures import fixtures
import mock
from oslo_config import cfg from oslo_config import cfg
from oslotest import base as oslo_test from oslotest import base as oslo_test
import sqlalchemy import sqlalchemy

View File

@ -13,10 +13,10 @@
# 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 urllib import parse from urllib import parse
import fixtures import fixtures
import mock
from oslotest import base as test_base from oslotest import base as test_base
import sqlalchemy import sqlalchemy
from sqlalchemy.dialects import mysql from sqlalchemy.dialects import mysql

View File

@ -15,7 +15,8 @@
"""Unit tests for DB API.""" """Unit tests for DB API."""
import mock from unittest import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils from oslo_utils import importutils

View File

@ -14,8 +14,7 @@
# under the License. # under the License.
import sys import sys
from unittest import mock
import mock
from oslo_db import concurrency from oslo_db import concurrency
from oslo_db.tests import utils as test_utils from oslo_db.tests import utils as test_utils

View File

@ -5,7 +5,6 @@ hacking>=3.0,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
python-subunit>=1.0.0 # Apache-2.0/BSD python-subunit>=1.0.0 # Apache-2.0/BSD
oslotest>=3.2.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0
oslo.context>=2.19.2 # Apache-2.0 oslo.context>=2.19.2 # Apache-2.0