import unittest
from PyQt4 import QtCore, QtGui

class TestSequenceFunctions(unittest.TestCase):
   def setUp(self):
      self.app = QtGui.QApplication([])

   def onButtonClicked(self, checked = True):
      # Exception is raised in the signal handler, but the test
      # succeeds because the exception is only printed.
      raise Exception("Error in clicked handler")

   def test_exceptionTranslation(self):
      button = QtGui.QPushButton()
      button.clicked.connect(self.onButtonClicked)

      button.click()


if __name__ == '__main__':
   unittest.main()
