'Changing the `Target class` combo box should update colors.'

def test_changing_target_class_changes_coloring(self):

    def _test(data_type):
        (colors, tree) = ([], self._pick_random_tree())
        def _callback():
            colors.append([sq.brush().color() for sq in self._get_visible_squares(tree)])
        simulate.combobox_run_through_all(self.widget.ui_target_class_combo, callback=_callback)
        squares_same = [self._check_all_same(x) for x in zip(*colors)]
        self.assertTrue(any(((x is False) for x in squares_same)), ('Colors    did    not    change    for    %s    data' % data_type))
    self.send_signal('Random    forest', self.titanic)
    _test('classification')
    self.send_signal('Random    forest', self.housing)
    _test('regression')
