'Data with a class with one value causes widget to crash when that value
is selected.
GH-2351'

def test_one_class_value(self):

    table = Table(Domain([ContinuousVariable('a'), ContinuousVariable('b')], [DiscreteVariable('c', values=['y'])]), list(zip([42.48, 16.84, 15.23, 23.8], [1.0, 2.0, 3.0, 4.0], 'yyyy')))
    self.widget.n_folds = 0
    self.widget.class_selection = 'y'
    self.assertFalse(self.widget.Error.only_one_class_var_value.is_shown())
    self.send_signal('Data', table)
    self.send_signal('Learner', MajorityLearner(), 0, wait=1000)
    self.assertTrue(self.widget.Error.only_one_class_var_value.is_shown())
