def test_scope_garbage_collection(self):
        def inner():
            input_node = Input()
            output_node = Node(action=lambda value: value,
                               inputs=Node.inputs(input_node))
            self.assertEqual(set([output_node]), input_node._dependents)
            self.assertEqual((input_node,), output_node._positional_inputs)
            return weakref.ref(input_node), weakref.ref(output_node)

        input_ref, output_ref = inner()
        gc.collect()
        self.assertEqual(None, input_ref())
        self.assertEqual(None, output_ref())
Interconnected nodes which out of scope are garbage collected
dataset/ETHPy150Open akaihola/lusmu/lusmu/tests/test_core.py/BaseNodeGarbageCollectionTestCase.test_scope_garbage_collection