'Check that widget shows error message when learner fails'

def test_error_on_learning(self):

    class FailingLearner(Learner, ):
        'A    learner    that    fails    when    given    data'
        __returns__ = Model
        def __call__(self, data, *_):
            if (data is not None):
                raise ValueError('boom')
            return Model(Domain([]))
    class OWFailingLearner(OWBaseLearner, ):
        'Widget    for    the    above    learner'
        name = learner_name = 'foo'
        LEARNER = FailingLearner
        auto_apply = True
    self.widget = self.create_widget(OWFailingLearner)
    self.send_signal('Data', self.iris)
    self.assertTrue(self.widget.Error.fitting_failed.is_shown())
    self.send_signal('Data', None)
    self.assertFalse(self.widget.Error.fitting_failed.is_shown())
