Merge "Fixed some warnings about imports and variable"
This commit is contained in:
commit
547988a26e
@ -16,10 +16,10 @@ import time
|
||||
import unittest
|
||||
|
||||
from concurrent import futures
|
||||
from mock import mock, patch
|
||||
from mock import mock
|
||||
from mock import patch
|
||||
from oslo_serialization import jsonutils
|
||||
import pika
|
||||
from pika import spec
|
||||
|
||||
import oslo_messaging
|
||||
from oslo_messaging._drivers.pika_driver import pika_engine
|
||||
|
@ -203,8 +203,7 @@ class TestKafkaListener(test_utils.BaseTestCase):
|
||||
def test_create_listener(self, fake_consumer, fake_ensure_connection):
|
||||
fake_target = oslo_messaging.Target(topic='fake_topic')
|
||||
fake_targets_and_priorities = [(fake_target, 'info')]
|
||||
listener = self.driver.listen_for_notifications(
|
||||
fake_targets_and_priorities)
|
||||
self.driver.listen_for_notifications(fake_targets_and_priorities)
|
||||
self.assertEqual(1, len(fake_consumer.mock_calls))
|
||||
|
||||
@mock.patch.object(kafka_driver.Connection, '_ensure_connection')
|
||||
|
@ -16,18 +16,12 @@ import pickle
|
||||
import time
|
||||
|
||||
import contextlib
|
||||
import fixtures
|
||||
import testtools
|
||||
|
||||
|
||||
import oslo_messaging
|
||||
from oslo_messaging._drivers import impl_zmq
|
||||
from oslo_messaging._drivers.zmq_driver import zmq_async
|
||||
from oslo_messaging._drivers.zmq_driver import zmq_socket
|
||||
from oslo_messaging._drivers.zmq_driver.client import zmq_request
|
||||
from oslo_messaging._drivers.zmq_driver.client.publishers \
|
||||
import zmq_pub_publisher
|
||||
from oslo_messaging.tests import utils as test_utils
|
||||
from oslo_messaging._drivers.zmq_driver.client import zmq_request
|
||||
from oslo_messaging.tests.drivers.zmq import zmq_common
|
||||
|
||||
|
||||
|
@ -14,8 +14,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import time
|
||||
import threading
|
||||
import time
|
||||
|
||||
# eventlet 0.16 with monkey patching does not work yet on Python 3,
|
||||
# so make aioeventlet, eventlet and trollius import optional
|
||||
|
@ -18,8 +18,8 @@ import multiprocessing
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import uuid
|
||||
import threading
|
||||
import uuid
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
@ -58,7 +58,7 @@ class QueueHandler(logging.Handler):
|
||||
ei = record.exc_info
|
||||
if ei:
|
||||
# just to get traceback text into record.exc_text
|
||||
dummy = self.format(record)
|
||||
dummy = self.format(record) # noqa
|
||||
record.exc_info = None # not needed any more
|
||||
self.queue.put_nowait(record)
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
|
@ -24,7 +24,7 @@ class TestDeprecationWarning(test_utils.BaseTestCase):
|
||||
# Tests that we get a deprecation warning when loading a messaging
|
||||
# driver out of oslo_messaging.notify._impl_messaging.
|
||||
from oslo_messaging.notify import _impl_messaging as messaging
|
||||
driver = messaging.MessagingV2Driver(
|
||||
driver = messaging.MessagingV2Driver( # noqa
|
||||
conf={}, topics=['notifications'], transport='rpc')
|
||||
# Make sure we got a deprecation warning by loading from the alias
|
||||
self.assertEqual(1, mock_warn.call_count)
|
||||
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
import threading
|
||||
import time
|
||||
|
||||
from oslo_config import cfg
|
||||
import testscenarios
|
||||
|
@ -29,8 +29,8 @@ import yaml
|
||||
|
||||
import oslo_messaging
|
||||
from oslo_messaging.notify import _impl_log
|
||||
from oslo_messaging.notify import messaging
|
||||
from oslo_messaging.notify import _impl_test
|
||||
from oslo_messaging.notify import messaging
|
||||
from oslo_messaging.notify import notifier as msg_notifier
|
||||
from oslo_messaging import serializer as msg_serializer
|
||||
from oslo_messaging.tests import utils as test_utils
|
||||
|
Loading…
x
Reference in New Issue
Block a user