@skipif('__pypy__' in sys.builtin_module_names, reason='cannot test this on pypy')
def test_no_memory_leak():
    def stub(v=''): pass
    
    class Foo(HasSignals):
        @input
        def parent(self, v):
            return v
    
    class Test(HasSignals):
        
        def __init__(self):
            self.foo = Foo(parent=self)  # Test no holding on _value and _last_value
            self.bar = Signal(stub, [])  # Test no holding via frame
            HasSignals.__init__(self)
        
        @connect('foo.title')
        def title_len(self, v):
            return len(v)
    
    t = Test()
    wt = weakref.ref(t)
    assert sys.getrefcount(t) >= 3  # pypy does not have getrefcount()
    
    t.disconnect_signals()
    t.foo.disconnect_signals()
    t.bar.disconnect()
    del t
    assert wt() is None  # pypy fails here, maybe needs a gc.collect()?
dataset/ETHPy150Open zoofIO/flexx/flexx/react/tests/test_hassignals.py/test_no_memory_leak/original