From a153826d0520b7772d459af80d05d31f9c1a9872 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Thu, 15 Aug 2019 10:55:14 +0200 Subject: 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 --- sources/pyside2/tests/QtCore/qslot_object_test.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'sources/pyside2') 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() -- cgit v1.2.3