Merge "Use unittest.mock on Python 3"

This commit is contained in:
Jenkins 2015-04-16 10:13:12 +00:00 committed by Gerrit Code Review
commit 1305d3e3b8
28 changed files with 32 additions and 29 deletions

View File

@ -13,6 +13,9 @@
# 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 oslotest before importing test submodules to setup six.moves for mock
import oslotest
try: try:
import eventlet import eventlet
except ImportError: except ImportError:

View File

@ -17,7 +17,6 @@ import random
import threading import threading
import time import time
import mock
try: try:
import qpid import qpid
except ImportError: except ImportError:
@ -30,6 +29,7 @@ import oslo_messaging
from oslo_messaging._drivers import amqp from oslo_messaging._drivers import amqp
from oslo_messaging._drivers import impl_qpid as qpid_driver from oslo_messaging._drivers import impl_qpid as qpid_driver
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -22,7 +22,6 @@ import uuid
import fixtures import fixtures
import kombu import kombu
import kombu.transport.memory import kombu.transport.memory
import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslotest import mockpatch from oslotest import mockpatch
@ -34,6 +33,7 @@ from oslo_messaging._drivers import amqpdriver
from oslo_messaging._drivers import common as driver_common from oslo_messaging._drivers import common as driver_common
from oslo_messaging._drivers import impl_rabbit as rabbit_driver from oslo_messaging._drivers import impl_rabbit as rabbit_driver
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -17,7 +17,6 @@ import logging
import socket import socket
import fixtures import fixtures
import mock
from oslo_utils import importutils from oslo_utils import importutils
import testtools import testtools
@ -29,6 +28,7 @@ except ImportError:
import oslo_messaging import oslo_messaging
from oslo_messaging._drivers import common as rpc_common from oslo_messaging._drivers import common as rpc_common
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
# eventlet is not yet py3 compatible, so skip if not installed # eventlet is not yet py3 compatible, so skip if not installed
eventlet = importutils.try_import('eventlet') eventlet = importutils.try_import('eventlet')

View File

@ -27,7 +27,6 @@ try:
import eventlet import eventlet
except ImportError: except ImportError:
eventlet = None eventlet = None
import mock
import testscenarios import testscenarios
import testtools import testtools
try: try:
@ -47,6 +46,7 @@ except ImportError:
impl_eventlet = None impl_eventlet = None
from oslo_messaging._executors import impl_thread from oslo_messaging._executors import impl_thread
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -15,13 +15,13 @@
import itertools import itertools
import mock
from oslo_utils import timeutils from oslo_utils import timeutils
import testscenarios import testscenarios
import oslo_messaging import oslo_messaging
from oslo_messaging.notify import dispatcher as notify_dispatcher from oslo_messaging.notify import dispatcher as notify_dispatcher
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -16,13 +16,13 @@
import threading import threading
import time import time
import mock
from oslo_config import cfg from oslo_config import cfg
import testscenarios import testscenarios
import oslo_messaging import oslo_messaging
from oslo_messaging.notify import dispatcher from oslo_messaging.notify import dispatcher
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -12,12 +12,11 @@
import logging import logging
import mock
import oslo_messaging import oslo_messaging
from oslo_messaging.notify import log_handler from oslo_messaging.notify import log_handler
from oslo_messaging.tests.notify import test_notifier from oslo_messaging.tests.notify import test_notifier
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
class PublishErrorsHandlerTestCase(test_utils.BaseTestCase): class PublishErrorsHandlerTestCase(test_utils.BaseTestCase):

View File

@ -18,7 +18,6 @@ import logging.config
import os import os
import sys import sys
import mock
from oslo_utils import timeutils from oslo_utils import timeutils
import testscenarios import testscenarios
import testtools import testtools
@ -26,6 +25,7 @@ import testtools
import oslo_messaging import oslo_messaging
from oslo_messaging.tests.notify import test_notifier from oslo_messaging.tests.notify import test_notifier
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -15,11 +15,11 @@
import uuid import uuid
import mock
import webob import webob
from oslo_messaging.notify import middleware from oslo_messaging.notify import middleware
from oslo_messaging.tests import utils from oslo_messaging.tests import utils
from six.moves import mock
class FakeApp(object): class FakeApp(object):

View File

@ -19,7 +19,6 @@ import sys
import uuid import uuid
import fixtures import fixtures
import mock
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_utils import timeutils from oslo_utils import timeutils
from stevedore import dispatch from stevedore import dispatch
@ -34,6 +33,7 @@ from oslo_messaging.notify import _impl_test
from oslo_messaging.notify import notifier as msg_notifier from oslo_messaging.notify import notifier as msg_notifier
from oslo_messaging import serializer as msg_serializer from oslo_messaging import serializer as msg_serializer
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -13,12 +13,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
import testscenarios import testscenarios
import oslo_messaging import oslo_messaging
from oslo_messaging import serializer as msg_serializer from oslo_messaging import serializer as msg_serializer
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -15,12 +15,12 @@
import threading import threading
import mock
from oslo_config import cfg from oslo_config import cfg
import testscenarios import testscenarios
import oslo_messaging import oslo_messaging
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -13,11 +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.
import mock
from oslo_messaging._drivers import common from oslo_messaging._drivers import common
from oslo_messaging import _utils as utils from oslo_messaging import _utils as utils
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
class VersionIsCompatibleTestCase(test_utils.BaseTestCase): class VersionIsCompatibleTestCase(test_utils.BaseTestCase):

View File

@ -7,7 +7,6 @@ hacking>=0.10.0,<0.11
discover discover
fixtures>=0.3.14 fixtures>=0.3.14
mock>=1.0
mox3>=0.7.0 mox3>=0.7.0
python-subunit>=0.0.18 python-subunit>=0.0.18
testrepository>=0.0.18 testrepository>=0.0.18

View File

@ -13,6 +13,9 @@
# 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 oslotest before importing test submodules to setup six.moves for mock
import oslotest
try: try:
import eventlet import eventlet
except ImportError: except ImportError:

View File

@ -17,7 +17,6 @@ import random
import threading import threading
import time import time
import mock
try: try:
import qpid import qpid
except ImportError: except ImportError:
@ -30,6 +29,7 @@ from oslo import messaging
from oslo_messaging._drivers import amqp from oslo_messaging._drivers import amqp
from oslo_messaging._drivers import impl_qpid as qpid_driver from oslo_messaging._drivers import impl_qpid as qpid_driver
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -20,7 +20,6 @@ import uuid
import fixtures import fixtures
import kombu import kombu
import mock
from oslotest import mockpatch from oslotest import mockpatch
import testscenarios import testscenarios
@ -32,6 +31,7 @@ from oslo_messaging._drivers import amqpdriver
from oslo_messaging._drivers import common as driver_common from oslo_messaging._drivers import common as driver_common
from oslo_messaging._drivers import impl_rabbit as rabbit_driver from oslo_messaging._drivers import impl_rabbit as rabbit_driver
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -17,9 +17,10 @@ import logging
import socket import socket
import fixtures import fixtures
import mock
import testtools import testtools
from six.moves import mock
try: try:
import zmq import zmq
except ImportError: except ImportError:

View File

@ -15,13 +15,13 @@
import itertools import itertools
import mock
from oslo_utils import timeutils from oslo_utils import timeutils
import testscenarios import testscenarios
from oslo import messaging from oslo import messaging
from oslo.messaging.notify import dispatcher as notify_dispatcher from oslo.messaging.notify import dispatcher as notify_dispatcher
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -16,13 +16,13 @@
import threading import threading
import time import time
import mock
import testscenarios import testscenarios
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging from oslo import messaging
from oslo.messaging.notify import dispatcher from oslo.messaging.notify import dispatcher
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -12,12 +12,11 @@
import logging import logging
import mock
from oslo import messaging from oslo import messaging
from oslo.messaging.notify import log_handler from oslo.messaging.notify import log_handler
from oslo_messaging.tests.notify import test_notifier from oslo_messaging.tests.notify import test_notifier
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
class PublishErrorsHandlerTestCase(test_utils.BaseTestCase): class PublishErrorsHandlerTestCase(test_utils.BaseTestCase):

View File

@ -18,7 +18,6 @@ import logging.config
import os import os
import sys import sys
import mock
from oslo_utils import timeutils from oslo_utils import timeutils
import testscenarios import testscenarios
import testtools import testtools
@ -27,6 +26,7 @@ from oslo import messaging
import oslo_messaging import oslo_messaging
from oslo_messaging.tests.notify import test_notifier from oslo_messaging.tests.notify import test_notifier
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -15,11 +15,11 @@
import uuid import uuid
import mock
import webob import webob
from oslo.messaging.notify import middleware from oslo.messaging.notify import middleware
from oslo_messaging.tests import utils from oslo_messaging.tests import utils
from six.moves import mock
class FakeApp(object): class FakeApp(object):

View File

@ -19,7 +19,6 @@ import sys
import uuid import uuid
import fixtures import fixtures
import mock
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_utils import timeutils from oslo_utils import timeutils
from stevedore import dispatch from stevedore import dispatch
@ -34,6 +33,7 @@ from oslo_messaging.notify import _impl_log
from oslo_messaging.notify import _impl_messaging from oslo_messaging.notify import _impl_messaging
from oslo_messaging.notify import _impl_test from oslo_messaging.notify import _impl_test
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -13,12 +13,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
import testscenarios import testscenarios
from oslo import messaging from oslo import messaging
from oslo.messaging import serializer as msg_serializer from oslo.messaging import serializer as msg_serializer
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -15,12 +15,12 @@
import threading import threading
import mock
import testscenarios import testscenarios
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging from oslo import messaging
from oslo_messaging.tests import utils as test_utils from oslo_messaging.tests import utils as test_utils
from six.moves import mock
load_tests = testscenarios.load_tests_apply_scenarios load_tests = testscenarios.load_tests_apply_scenarios

View File

@ -14,9 +14,9 @@ import imp
import os import os
import warnings import warnings
import mock
from oslotest import base as test_base from oslotest import base as test_base
import six import six
from six.moves import mock
class DeprecationWarningTest(test_base.BaseTestCase): class DeprecationWarningTest(test_base.BaseTestCase):