'Handling memory error.
GH-2397'

def test_out_of_memory(self):

    data = Table('iris')[::3]
    self.assertFalse(self.widget.Error.out_of_memory.is_shown())
    with unittest.mock.patch('Orange.widgets.model.owrules.CustomRuleLearner.__call__', side_effect=MemoryError):
        self.send_signal('Data', data)
        self.assertTrue(self.widget.Error.out_of_memory.is_shown())
    self.send_signal('Data', None)
    self.assertFalse(self.widget.Error.out_of_memory.is_shown())
