From 7506d013bd3122a8c69d6be6e435b4d341fa26f8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 7 Sep 2021 12:07:26 +0200 Subject: PySide6: Fix QThreadPool test The test used deprecated/removed functions of QTime, causing: AttributeError: 'PySide6.QtCore.QTime' object has no attribute 'start' Use QThread instead. Change-Id: Ib6c7d043d3386eae3c1145b5966c86bc8c31562f Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit d3877ec7445bc7719aff233bae16243b563d5a04) Reviewed-by: Qt Cherry-pick Bot --- sources/pyside6/tests/QtCore/bug_927.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sources/pyside6/tests/QtCore/bug_927.py b/sources/pyside6/tests/QtCore/bug_927.py index 1a9617481..5a513b83a 100644 --- a/sources/pyside6/tests/QtCore/bug_927.py +++ b/sources/pyside6/tests/QtCore/bug_927.py @@ -36,14 +36,12 @@ 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 QTime, QRunnable, QThreadPool +from PySide6.QtCore import QRunnable, QThread, QThreadPool class Task(QRunnable): def run(self): - t = QTime() - t.start() - time.sleep(2) # Sleep 2 seconds + QThread.sleep(2) # Sleep 2 seconds class QThreadPoolTest(unittest.TestCase): -- cgit v1.2.3