'Widget emits messageActivates/messageDeactivated signals'

def test_widget_emits_messages(self):

    w = WidgetMsgTestCase.TestWidget()
    messages = set(self.active_messages(w))
    self.assertEqual(len(messages), 1)
    w.messageActivated.connect(messages.add)
    w.messageDeactivated.connect(messages.remove)
    w.Information.hello()
    self.assertEqual(len(messages), 1)
    self.assertSetEqual(messages, set(self.active_messages(w)))
    w.Information.hello.clear()
    self.assertEqual(len(messages), 0)
    self.assertSetEqual(set(self.active_messages(w)), set())
    with patch.object(WidgetMsgTestCase.TestWidget, 'want_basic_layout', False):
        w = WidgetMsgTestCase.TestWidget()
    messages = set(self.active_messages(w))
    w.messageActivated.connect(messages.add)
    w.messageDeactivated.connect(messages.remove)
    self.assertEqual(len(messages), 1)
    w.Information.hello.clear()
    self.assertEqual(len(messages), 0)
