def test_weak_method_subscriptions(self):
        called = []
        class Foo(object):
            def foo(self, a):
                called.append(a)
        f = Foo()

        sig = signals.Signal('FOO', ('a',))
        sig.connect(f.foo)
        sig.emit(a=42)

        self.assertEqual(called, [42])
        sig.disconnect(f.foo)

        del f
        gc.collect()

        sig.emit(a=23)
        self.assertEqual(called, [42])
Weak method signal subscriptions
dataset/ETHPy150Open mitsuhiko/solace/solace/tests/signals.py/SignalTestCase.test_weak_method_subscriptions