def test__enter__exit__(self):
    pub = compat.Publisher(self.connection, exchange='test_Publisher_send', routing_key='rkey')
    x = pub.__enter__()
    self.assertIs(x, pub)
    x.__exit__()
    self.assertTrue(pub._closed)
def test__enter__exit__(self):
    pub = compat.Publisher(self.connection, exchange='test_Publisher_send', routing_key='rkey')
    x = pub.__enter__()
    self.assertIs(x, pub)
    x.__exit__()
    self.assertTrue(pub._closed)