aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtCore/bug_PYSIDE-164.py')
-rw-r--r--sources/pyside6/tests/QtCore/bug_PYSIDE-164.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py b/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
index c5a6736a8..84859af84 100644
--- a/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
+++ b/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
@@ -10,16 +10,19 @@ 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, QEventLoop, QObject, Qt, QThread, QTimer, SIGNAL
+from PySide6.QtCore import QCoreApplication, QEventLoop, QObject, Qt, QThread, Signal
class Emitter(QThread):
+
+ signal = Signal(int)
+
def __init__(self):
super().__init__()
def run(self):
print("Before emit.")
- self.emit(SIGNAL("signal(int)"), 0)
+ self.signal.emit(0)
print("After emit.")
@@ -36,12 +39,11 @@ class Receiver(QObject):
class TestBugPYSIDE164(unittest.TestCase):
def testBlockingSignal(self):
- app = QCoreApplication.instance() or QCoreApplication([])
+ app = QCoreApplication.instance() or QCoreApplication([]) # noqa: F841
eventloop = QEventLoop()
emitter = Emitter()
receiver = Receiver(eventloop)
- emitter.connect(emitter, SIGNAL("signal(int)"),
- receiver.receive, Qt.BlockingQueuedConnection)
+ emitter.signal.connect(receiver.receive, Qt.BlockingQueuedConnection)
emitter.start()
retval = eventloop.exec()
emitter.wait(2000)