tests: Add testprocess.wait_for_quit.

This was in conftest.py before, but we might want to use it outside of that as
well.
This commit is contained in:
Florian Bruhin 2016-01-20 06:54:00 +01:00
parent ef17c86586
commit d3f0c27a87
2 changed files with 7 additions and 3 deletions

View File

@ -465,6 +465,4 @@ def clipboard_contains_multiline(qtbot, qapp, content):
@bdd.then("qutebrowser should quit")
def should_quit(qtbot, quteproc):
quteproc.exit_expected = True
with qtbot.waitSignal(quteproc.proc.finished, timeout=15000):
pass
quteproc.wait_for_quit()

View File

@ -417,3 +417,9 @@ class Process(QObject):
return
else:
raise BlacklistedMessageError(line)
def wait_for_quit(self):
"""Wait until the process has quit."""
self.exit_expected = True
with self._wait_signal(self.proc.finished, timeout=15000):
pass