aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-08-15 10:55:14 +0200
committerChristian Tismer <tismer@stackless.com>2019-08-15 17:58:09 +0200
commita153826d0520b7772d459af80d05d31f9c1a9872 (patch)
tree4525d46ee1668c8ed346e43a65415dcdaa5fb975
parent2fdc5a867ee5e3080166fe383a1fe358abe4cd66 (diff)
simplify the qslot_object_test to use the qApp macro
The qslot_object_test needed an adjustment, because it uses the name "qApp" without being aware that a qApp builtin variable exists for exactly that purpose. Change-Id: Ic3df95ee33ece5de573b2dcc6ec2d6e2a1ffee73 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--sources/pyside2/tests/QtCore/qslot_object_test.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/sources/pyside2/tests/QtCore/qslot_object_test.py b/sources/pyside2/tests/QtCore/qslot_object_test.py
index b8d5513ff..7a2691a06 100644
--- a/sources/pyside2/tests/QtCore/qslot_object_test.py
+++ b/sources/pyside2/tests/QtCore/qslot_object_test.py
@@ -31,7 +31,10 @@
import unittest
from PySide2 import QtCore
-global qApp
+"""
+This is a simple slot test that was updated to use the qApp "macro".
+It is implicitly in builtins and does not need an import.
+"""
class objTest(QtCore.QObject):
@@ -41,21 +44,15 @@ class objTest(QtCore.QObject):
self.ok = False
def slot(self):
- global qApp
-
self.ok = True
qApp.quit()
-
class slotTest(unittest.TestCase):
def quit_app(self):
- global qApp
-
qApp.quit()
def testBasic(self):
- global qApp
timer = QtCore.QTimer()
timer.setInterval(100)
@@ -71,6 +68,5 @@ class slotTest(unittest.TestCase):
if __name__ == '__main__':
- global qApp
- qApp = QtCore.QCoreApplication([])
+ QtCore.QCoreApplication()
unittest.main()