Skip to content

Commit

Permalink
Queue.iterator is read-only now
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
  • Loading branch information
abompard authored and renovate[bot] committed Dec 1, 2023
1 parent 2bc8d1d commit 0dfef96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/sender/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def test_connect(mocked_connection, mocked_channel, consumer):
mocked_channel.mocked_queue.bind.assert_called_once_with("amq.direct", "send.testdest")


async def test_consume(mocked_channel, consumer):
async def test_consume(mocked_channel, consumer, mocker):
consumer._queue = Queue(
mocked_channel,
name="testqueue",
Expand All @@ -81,7 +81,7 @@ async def test_consume(mocked_channel, consumer):
)
# Make sure we always return the same iterator instance
iterator = QueueIterator(consumer._queue)
consumer._queue.iterator = Mock(return_value=iterator)
mocker.patch("aio_pika.queue.QueueIterator", Mock(return_value=iterator))

future = consumer.start()
await iterator.on_message(make_message(mocked_channel, {"foo": "bar"}))
Expand Down

0 comments on commit 0dfef96

Please sign in to comment.