From d3f0c27a87dba0503e0d0edcdd76924684ec1a1e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 20 Jan 2016 06:54:00 +0100 Subject: [PATCH] tests: Add testprocess.wait_for_quit. This was in conftest.py before, but we might want to use it outside of that as well. --- tests/integration/features/conftest.py | 4 +--- tests/integration/testprocess.py | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index bffc6b2e4..1208cf42e 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -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() diff --git a/tests/integration/testprocess.py b/tests/integration/testprocess.py index 79fb5494d..0b527b38b 100644 --- a/tests/integration/testprocess.py +++ b/tests/integration/testprocess.py @@ -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