'if connection is closing but closing channels remain, do not call         _on_close_ready'

@mock.patch('pika.connection.Connection._on_close_ready')
def test_on_channel_cleanup_with_closing_channels(self, on_close_ready):

    self.channel.is_open = False
    self.channel.is_closing = True
    self.channel.is_closed = False
    self.connection.close()
    self.assertFalse(on_close_ready.called, '_on_close_ready    should    not    have    been    called')
