def test_state(self): l = [next(self.slicer)] saved = self.slicer.key restored = thaw(saved) l.append(next(restored)) self.assertEqual([51, 108], l)
def __init__(self, msg=None, datasource=None): Task.__init__(self, msg) self._lock = RLock() # general lock self.subtask = None # subtask that is parallelized self.__subtask_class = None # class of subtask self.__subtask_args = None # args for initializing subtask self.__subtask_kwargs = None # kwargs for initializing subtask if datasource: self._ds = thaw(datasource) self.logger = logging.getLogger('root')