Skip to content

Commit

Permalink
Undeprecate auto_delete flag for exchanges. (#287)
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 authored and thedrow committed Aug 13, 2019
1 parent ccbe683 commit fa4b58a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
9 changes: 0 additions & 9 deletions amqp/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import logging
import socket
from collections import defaultdict
from warnings import warn

from vine import ensure_promise

Expand All @@ -21,11 +20,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 +607,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 fa4b58a

Please sign in to comment.