def testTaskInstance(self):
        
        AdderInstance = TaskInstance(True)

        try:
            AdderInstance.sum(10)
            self.fail('expected attribute error')
        except AttributeError:
            pass
        
        def t():
            return AdderInstance.sum(20)
            
        with AdderInstance.set(Adder(10)):
            self.assertEquals(30, AdderInstance.sum(20))
            #check that child task can also find it
            self.assertEquals(30, Tasklet.join(Tasklet.new(t)()))

        #should have been unset
        try:
            AdderInstance.sum(10)
            self.fail('expected attribute error')
        except __HOLE__:
            pass
dataset/ETHPy150Open concurrence/concurrence/test/testlocal.py/TestTaskInstance.testTaskInstance