diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-03 14:54:59 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-03 15:44:16 +0200 |
commit | cf718aa8d16429bc9d575de56d8451ae962fb13f (patch) | |
tree | 2ec142bd834267852ccb9ab13af728d3925f30ce /sources/pyside2/tests | |
parent | 374234889bfc8a7b9afbf92c5787090a4ca85aaf (diff) |
Fix up qprocess_test.py
Fix deprecated API and wait for the process to finish, fixing:
DeprecationWarning: QProcess.start(const QString & command, QFlags<QIODevice::OpenModeFlag> mode) is deprecated
p.start("dir")
QProcess: Destroyed while process ("dir") is still running.
Change-Id: Ib1705c9723fa1e72ea650d6f541506b62487aff7
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r-- | sources/pyside2/tests/QtCore/qprocess_test.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sources/pyside2/tests/QtCore/qprocess_test.py b/sources/pyside2/tests/QtCore/qprocess_test.py index eb5753f45..ec0c9251d 100644 --- a/sources/pyside2/tests/QtCore/qprocess_test.py +++ b/sources/pyside2/tests/QtCore/qprocess_test.py @@ -50,13 +50,14 @@ class TestQProcess (unittest.TestCase): def testPid(self): p = QProcess() - p.start("dir") + p.start("dir", []) p.waitForStarted() pid = p.pid() # We can't test the pid method result because it returns 0 when the # process isn't running if p.state() == QProcess.Running: self.assertNotEqual(pid, 0) + p.waitForFinished() else: print("PROCESS ALREADY DEAD :-/") |