Exemplo n.º 1
0
 def test_pickle(self):
     """Make sure data is not saved when pickling a model."""
     model = Model(Domain([]))
     model.original_data = [1, 2, 3]
     model2 = pickle.loads(pickle.dumps(model))
     self.assertEqual(model.domain, model2.domain)
     self.assertEqual(model.original_data, [1, 2, 3])
     self.assertEqual(model2.original_data, None)
Exemplo n.º 2
0
 def __call__(self, data, *_):
     if data is not None:
         raise ValueError("boom")
     return Model(Domain([]))