From fa4b58af62ae4acd2816d67ef349f10e1893035f Mon Sep 17 00:00:00 2001 From: Gilbert Gilb's Date: Tue, 13 Aug 2019 12:53:12 +0200 Subject: [PATCH] Undeprecate auto_delete flag for exchanges. (#287) It was undeprecated from AMQP. See https://www.rabbitmq.com/amqp-0-9-1-errata.html#section_25 Fixes #286 --- amqp/channel.py | 9 --------- t/unit/test_channel.py | 10 ++++------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/amqp/channel.py b/amqp/channel.py index ed7bc1a3..8d341ed2 100644 --- a/amqp/channel.py +++ b/amqp/channel.py @@ -5,7 +5,6 @@ import logging import socket from collections import defaultdict -from warnings import warn from vine import ensure_promise @@ -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.\ @@ -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, diff --git a/t/unit/test_channel.py b/t/unit/test_channel.py index eb65644f..1e05442d 100644 --- a/t/unit/test_channel.py +++ b/t/unit/test_channel.py @@ -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')