Add UsesQCoreApplication in state machine test
This commit is contained in:
parent
8b35d247f8
commit
29f6a260e4
1 changed files with 5 additions and 5 deletions
|
|
@ -2,14 +2,14 @@
|
||||||
import unittest
|
import unittest
|
||||||
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
|
from PySide.QtCore import QObject, QState, QFinalState, SIGNAL, QCoreApplication, QTimer, QStateMachine, QSignalTransition, QVariant, QParallelAnimationGroup, QPropertyAnimation
|
||||||
|
|
||||||
class QStateMachineTest(unittest.TestCase):
|
from helper import UsesQCoreApplication
|
||||||
|
|
||||||
|
class QStateMachineTest(UsesQCoreApplication):
|
||||||
|
|
||||||
def cb(self, *args):
|
def cb(self, *args):
|
||||||
self.assertEqual(self.machine.defaultAnimations(), [self.anim])
|
self.assertEqual(self.machine.defaultAnimations(), [self.anim])
|
||||||
|
|
||||||
def testBasic(self):
|
def testBasic(self):
|
||||||
app = QCoreApplication([])
|
|
||||||
|
|
||||||
self.machine = QStateMachine()
|
self.machine = QStateMachine()
|
||||||
s1 = QState()
|
s1 = QState()
|
||||||
s2 = QState()
|
s2 = QState()
|
||||||
|
|
@ -26,8 +26,8 @@ class QStateMachineTest(unittest.TestCase):
|
||||||
self.machine.addDefaultAnimation(self.anim)
|
self.machine.addDefaultAnimation(self.anim)
|
||||||
self.machine.start()
|
self.machine.start()
|
||||||
|
|
||||||
QTimer.singleShot(100, app.quit)
|
QTimer.singleShot(100, self.app.quit)
|
||||||
app.exec_()
|
self.app.exec_()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue