def test_no_unpicklable_properties(self): task = luigi.Task() task.set_tracking_url = lambda tracking_url: tracking_url task.set_status_message = lambda message: message with task.no_unpicklable_properties(): pickle.dumps(task) self.assertIsNotNone(task.set_tracking_url) self.assertIsNotNone(task.set_status_message) tracking_url = task.set_tracking_url('http://test.luigi.com/') self.assertEqual(tracking_url, 'http://test.luigi.com/') message = task.set_status_message('message') self.assertEqual(message, 'message')