#!/usr/bin/python
import unittest
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation

class QStateMachineTest(unittest.TestCase):

    def cb(self, *args):
        self.assertEqual(self.machine.defaultAnimations(), [self.anim])

    def testBasic(self):
        app = QCoreApplication([])

        self.machine = QStateMachine()
        s1 = QState()
        s2 = QState()
        s3 = QFinalState()

        QObject.connect(self.machine, SIGNAL("started()"), self.cb)

        self.anim = QParallelAnimationGroup()

        self.machine.addState(s1)
        self.machine.addState(s2)
        self.machine.addState(s3)
        self.machine.setInitialState(s1)
        self.machine.addDefaultAnimation(self.anim)
        self.machine.start()

        QTimer.singleShot(100, app.quit)
        app.exec_()

if __name__ == '__main__':
    unittest.main()

@@ -206,16 +206,57 @@
 mation%0A%0A
+from helper import UsesQCoreApplication%0A%0A
 class QS
@@ -275,25 +275,28 @@
 est(
-unittest.TestCase
+UsesQCoreApplication
 ):%0A%0A
@@ -422,44 +422,8 @@
 f):%0A
-        app = QCoreApplication(%5B%5D)%0A%0A
     
@@ -901,16 +901,21 @@
 ot(100, 
+self.
 app.quit
@@ -924,16 +924,21 @@
         
+self.
 app.exec

Add UsesQCoreApplication in state machine test