From 1579f2756458794d38885e9db56f99599974dd08 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 20 Apr 2016 07:16:56 +0200 Subject: [PATCH] bdd: Add sections to log See #1418 --- tests/integration/features/conftest.py | 1 + tests/integration/quteprocess.py | 5 +++++ tests/integration/testprocess.py | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/tests/integration/features/conftest.py b/tests/integration/features/conftest.py index 2ff052937..5e7151f43 100644 --- a/tests/integration/features/conftest.py +++ b/tests/integration/features/conftest.py @@ -180,6 +180,7 @@ def wait_in_log(quteproc, is_regex, pattern, do_skip): r'"(?P.*)"')) def wait_for_message(quteproc, httpbin, category, message): """Wait for a given statusbar message/error/warning.""" + quteproc.log_summary('Waiting for {} "{}"'.format(category, message)) expect_message(quteproc, httpbin, category, message) diff --git a/tests/integration/quteprocess.py b/tests/integration/quteprocess.py index 03616301b..84a101e44 100644 --- a/tests/integration/quteprocess.py +++ b/tests/integration/quteprocess.py @@ -320,6 +320,11 @@ class QuteProc(testprocess.Process): def send_cmd(self, command, count=None): """Send a command to the running qutebrowser instance.""" + summary = command + if count is not None: + summary += ' (count {})'.format(count) + self._log_summary(summary) + assert self._ipc_socket is not None time.sleep(self._delay / 1000) diff --git a/tests/integration/testprocess.py b/tests/integration/testprocess.py index 5c50121e5..6998e2603 100644 --- a/tests/integration/testprocess.py +++ b/tests/integration/testprocess.py @@ -151,6 +151,11 @@ class Process(QObject): print(line) self.captured_log.append(line) + def _log_summary(self, text): + """Log the given line as summary/title.""" + text = '\n{line} {text} {line}\n'.format(line='='*50, text=text) + self._log(text) + def _parse_line(self, line): """Parse the given line from the log.