def test__enter__exit__(self, n='test__enter__exit__'):
    c = compat.Consumer(self.connection, queue=n, exchange=n, routing_key='rkey')
    x = c.__enter__()
    self.assertIs(x, c)
    x.__exit__()
    self.assertTrue(c._closed)
def test__enter__exit__(self, n='test__enter__exit__'):
    c = compat.Consumer(self.connection, queue=n, exchange=n, routing_key='rkey')
    x = c.__enter__()
    self.assertIs(x, c)
    x.__exit__()
    self.assertTrue(c._closed)