def test_weakref(self):
        '''Test sizing weak references.
        '''
        alive = Foo('alive')
        aref = weakref.ref(alive)
        dead = Foo('dead')
        dref = weakref.ref(dead)
        del dead
        aref_size = asizeof.asizeof(aref)
        self.assertTrue(aref_size > asizeof.asizeof(alive), aref_size)
        refs = asizeof.named_refs(aref)
        # TODO: Should a weakref return ('ref', obj)?
        dref_size = asizeof.asizeof(dref)
        self.assertTrue(dref_size > 0, dref_size)
        self.assertNotEqual(dref_size, aref_size)
        refs = asizeof.named_refs(dref)
dataset/ETHPy150Open pympler/pympler/test/asizeof/test_asizeof.py/TypesTest.test_weakref/original