Skip to content

Commit

Permalink
Undeprecate auto_delete flag for exchanges.
Browse files Browse the repository at this point in the history
It was undeprecated from AMQP.

See https://www.rabbitmq.com/amqp-0-9-1-errata.html#section_25

Fixes #286
  • Loading branch information
gilbsgilbs committed Aug 12, 2019
1 parent ccbe683 commit 268baee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
8 changes: 0 additions & 8 deletions amqp/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@

AMQP_LOGGER = logging.getLogger('amqp')

EXCHANGE_AUTODELETE_DEPRECATED = """\
The auto_delete flag for exchanges has been deprecated and will be removed
from py-amqp v1.5.0.\
"""

REJECTED_MESSAGE_WITHOUT_CALLBACK = """\
Rejecting message with delivery tag %r for reason of having no callbacks.
consumer_tag=%r exchange=%r routing_key=%r.\
Expand Down Expand Up @@ -613,9 +608,6 @@ def exchange_declare(self, exchange, type, passive=False, durable=False,
implementation. This field is ignored if passive is
True.
"""
if auto_delete:
warn(VDeprecationWarning(EXCHANGE_AUTODELETE_DEPRECATED))

self.send_method(
spec.Exchange.Declare, argsig,
(0, exchange, type, passive, durable, auto_delete,
Expand Down
10 changes: 4 additions & 6 deletions t/unit/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,10 @@ def test_exchange_declare(self):
)

def test_exchange_declare__auto_delete(self):
with patch('amqp.channel.warn') as warn:
self.c.exchange_declare(
'foo', 'direct', False, True,
auto_delete=True, nowait=False, arguments={'x': 1},
)
warn.assert_called()
self.c.exchange_declare(
'foo', 'direct', False, True,
auto_delete=True, nowait=False, arguments={'x': 1},
)

def test_exchange_delete(self):
self.c.exchange_delete('foo')
Expand Down

0 comments on commit 268baee

Please sign in to comment.