def test_send_on_dead_ref(self):
        class C:
            def foo(self, o, e):
                pass
        c = C()
        c1 = C()
        messenger.connect(c1, 'foo', c.foo)
        messenger.send(c1, 'foo')

        # Test if things behave sanely if a message was sent and one
        # of the callbacks has been gc'd.
        m = messenger.Messenger()
        l1 = len(m._signals[hash(c1)]['foo'])
        #
        del c
        messenger.send(c1, 'foo')
        #
        l2 = len(m._signals[hash(c1)]['foo'])
        # Since 'c' is gc'd this callback should have been cleared
        # out.
        self.assertEqual(l2, l1 - 1)

        # Clean up.
        messenger.disconnect(c1)
Initialize, but do not start the WSGI server.
dataset/ETHPy150Open enthought/mayavi/tvtk/tests/test_messenger.py/TestMessenger.test_send_on_dead_ref--crossover with--dataset/ETHPy150Open openstack/ec2-api/ec2api/service.py/WSGIService.__init__