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:
parent
4e6fe7cf7d
commit
b903d4e1ee
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue