From 6cf4cebfd40048da0428e575232b73552be2234b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 20 Apr 2016 07:49:08 +0200 Subject: [PATCH] bdd: Show messages we're waiting for in the log --- tests/integration/testprocess.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/integration/testprocess.py b/tests/integration/testprocess.py index 2d31c3d54..2dd6e5e28 100644 --- a/tests/integration/testprocess.py +++ b/tests/integration/testprocess.py @@ -31,6 +31,8 @@ from PyQt5.QtTest import QSignalSpy from helpers import utils +from qutebrowser.utils import utils as quteutils + class InvalidLine(Exception): @@ -421,6 +423,11 @@ class Process(QObject): return existing # If there is none, wait for the message + message = kwargs.get('message', None) + if message is not None: + elided = quteutils.elide(repr(message), 50) + self._log("\n----> Waiting for {} in the log".format(elided)) + spy = QSignalSpy(self.new_data) elapsed_timer = QElapsedTimer() elapsed_timer.start() @@ -439,6 +446,8 @@ class Process(QObject): match = self._wait_for_match(spy, kwargs) if match is not None: + if message is not None: + self._log("----> found it".format(message)) return match def ensure_not_logged(self, delay=500, **kwargs):