Merge "Bump hacking (again)"

This commit is contained in:
Zuul 2024-01-27 11:46:42 +00:00 committed by Gerrit Code Review
commit b5244bd05a
3 changed files with 14 additions and 12 deletions

View File

@ -32,7 +32,7 @@ repos:
- id: flake8
name: flake8
additional_dependencies:
- hacking>=3.0.1,<=4.1.0
- hacking>=6.1.0,<=6.2.0
language: python
entry: flake8
files: '^.*\.py$'

View File

@ -31,17 +31,17 @@ def check_oslo_namespace_imports(logical_line):
msg = ("O321: '%s' must be used instead of '%s'.") % (
logical_line.replace('oslo.', 'oslo_'),
logical_line)
yield(0, msg)
yield (0, msg)
elif re.match(oslo_namespace_imports_from_root, logical_line):
msg = ("O321: '%s' must be used instead of '%s'.") % (
logical_line.replace('from oslo import ', 'import oslo_'),
logical_line)
yield(0, msg)
yield (0, msg)
elif re.match(oslo_namespace_imports_dot, logical_line):
msg = ("O321: '%s' must be used instead of '%s'.") % (
logical_line.replace('import', 'from').replace('.', ' import '),
logical_line)
yield(0, msg)
yield (0, msg)
class BaseASTChecker(ast.NodeVisitor):

View File

@ -1530,26 +1530,27 @@ class TestMessageRetransmit(_AmqpBrokerTestCase):
def test_released(self):
# should retry and succeed
self._test_retransmit(lambda l, h: l.message_released(h))
self._test_retransmit(lambda link, handle:
link.message_released(handle))
def test_modified(self):
# should retry and succeed
self._test_retransmit(lambda l, h: l.message_modified(h,
False,
False,
{}))
self._test_retransmit(lambda link, handle:
link.message_modified(handle, False, False, {}))
def test_modified_failed(self):
# since delivery_failed is set to True, should fail
self.assertRaises(oslo_messaging.MessageDeliveryFailure,
self._test_retransmit,
lambda l, h: l.message_modified(h, True, False, {}))
lambda link, handle:
link.message_modified(handle, True, False, {}))
def test_rejected(self):
# rejected - should fail
self.assertRaises(oslo_messaging.MessageDeliveryFailure,
self._test_retransmit,
lambda l, h: l.message_rejected(h, {}))
lambda link, handle:
link.message_rejected(handle, {}))
@testtools.skipUnless(SSL_ENABLED, "OpenSSL not supported")
@ -2154,7 +2155,8 @@ class FakeBroker(threading.Thread):
self.on_sender_active = lambda link: None
self.on_receiver_active = lambda link: link.add_capacity(10)
self.on_credit_exhausted = lambda link: link.add_capacity(10)
self.on_message = lambda m, h, l: self.forward_message(m, h, l)
self.on_message = lambda message, handle, link: self.forward_message(
message, handle, link)
def start(self):
"""Start the server."""