def test_sharing_mode(): "Ensure sharing mode decorator turns on sharing" assert not lks.in_share_context() with lks.sharing_mode(): assert lks.in_share_context() assert not lks.in_share_context()
def __getstate__(self): state = dict(self.__dict__) if '_sim_inv_' in state and not in_share_context(): del state['_sim_inv_'] return state