def MockEnvelope(): m = MagicMock(spec=aioamqp.envelope.Envelope, name='MockEnvelope') m.delivery_tag = DELIVERY_TAG return m