aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/QtCore/bug_927.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/tests/QtCore/bug_927.py')
-rw-r--r--sources/pyside6/tests/QtCore/bug_927.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/sources/pyside6/tests/QtCore/bug_927.py b/sources/pyside6/tests/QtCore/bug_927.py
index 80f332979..1a9617481 100644
--- a/sources/pyside6/tests/QtCore/bug_927.py
+++ b/sources/pyside6/tests/QtCore/bug_927.py
@@ -38,22 +38,24 @@ init_test_paths(False)
from PySide6.QtCore import QTime, QRunnable, QThreadPool
+
class Task(QRunnable):
- def run(self):
- t = QTime()
- t.start()
- time.sleep(2) # Sleep 2 seconds
+ def run(self):
+ t = QTime()
+ t.start()
+ time.sleep(2) # Sleep 2 seconds
class QThreadPoolTest(unittest.TestCase):
'''This used to cause a segfault due the ownership control on globalInstance function '''
def testSlowJobs(self):
- for i in range(3):
- task = Task()
- QThreadPool.globalInstance().start(task)
- time.sleep(1) # Sleep 1 second
+ for i in range(3):
+ task = Task()
+ QThreadPool.globalInstance().start(task)
+ time.sleep(1) # Sleep 1 second
+
+ QThreadPool.globalInstance().waitForDone()
- QThreadPool.globalInstance().waitForDone()
if __name__ == '__main__':
unittest.main()