aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtCore/qslot_object_test.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-04 12:00:16 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-04-09 13:20:15 +0200
commit27efa8e4bc074efb0c05fc1462a8b46d60e5256b (patch)
tree3cd62a299ff56241a6cf55e10fb152cbf4d24121 /sources/pyside6/tests/QtCore/qslot_object_test.py
parent140b7df1263e2d24d1fc69b8ad305e8189d1dadc (diff)
Port the QtCore signals tests to modern syntax
Use the modern syntax where appropriate. Some tests are left unmodified to at least test the syntax. Pick-to: 6.7 Task-number: PYSIDE-2646 Change-Id: Idb16cda65ab1985f8be5fa5527b5a19e26fcec34 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/tests/QtCore/qslot_object_test.py')
-rw-r--r--sources/pyside6/tests/QtCore/qslot_object_test.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/sources/pyside6/tests/QtCore/qslot_object_test.py b/sources/pyside6/tests/QtCore/qslot_object_test.py
index 061ce9160..a95afb090 100644
--- a/sources/pyside6/tests/QtCore/qslot_object_test.py
+++ b/sources/pyside6/tests/QtCore/qslot_object_test.py
@@ -11,7 +11,7 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
-from PySide6.QtCore import QCoreApplication, QObject, QTimer, SIGNAL, SLOT
+from PySide6.QtCore import QCoreApplication, QObject, QTimer
"""
This is a simple slot test that was updated to use the qApp "macro".
@@ -28,24 +28,23 @@ class objTest(QObject):
def slot(self):
self.ok = True
- qApp.quit()
+ qApp.quit() # noqa: F821
class slotTest(unittest.TestCase):
def quit_app(self):
- qApp.quit()
+ qApp.quit() # noqa: F821
def testBasic(self):
timer = QTimer()
timer.setInterval(100)
my_obj = objTest()
- my_slot = SLOT("slot()")
- QObject.connect(timer, SIGNAL("timeout()"), my_obj, my_slot)
+ timer.timeout.connect(my_obj.slot)
timer.start(100)
QTimer.singleShot(1000, self.quit_app)
- qApp.exec()
+ qApp.exec() # noqa: F821
self.assertTrue(my_obj.ok)