def test_pickle(self): joblib.dump(CachedIterable(self.iterator(), 3), 'output') self.assertListEqual(list(joblib.load('output')), list(range(20)))