aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-09-07 12:07:26 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-07 12:38:43 +0000
commit7506d013bd3122a8c69d6be6e435b4d341fa26f8 (patch)
tree775352dab64456854d0316bfd1a4541281ee011a
parent1ae261182543492b641df00ce9ed1e131afd3c07 (diff)
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 <cristian.maureira-fredes@qt.io> (cherry picked from commit d3877ec7445bc7719aff233bae16243b563d5a04) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/pyside6/tests/QtCore/bug_927.py6
1 files 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):