

def testTaskInstance2(self):
    AdderInstance = TaskInstance(True)
    with AdderInstance.set(Adder(10)):
        self.assertEquals(30, AdderInstance.sum(20))

        def t():
            self.assertEquals(30, AdderInstance.sum(20))
            with AdderInstance.set(Adder(20)):
                self.assertEquals(40, AdderInstance.sum(20))
            self.assertEquals(30, AdderInstance.sum(20))
        t1 = Tasklet.new(t)()
        t2 = Tasklet.new(t)()
        Tasklet.join_all([t1, t2])
        self.assertEquals(30, AdderInstance.sum(20))

dataset/ETHPy150Open concurrence/concurrence/test/testlocal.py TestTaskInstance.testTaskInstance2/original