From d385206ea0d3470826242fcda79f1917e8746cda Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 29 May 2016 23:32:22 +0200 Subject: [PATCH] tests: Set some settings for quteproc We set ui -> message-timeout to 0 to get better error messages in the log output and network -> ssl-strict to not hang on unexpected SSL errors. --- tests/end2end/fixtures/quteprocess.py | 9 +++++++++ tests/end2end/fixtures/testprocess.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 120ac2b3a..ff5665d0d 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -297,6 +297,15 @@ class QuteProc(testprocess.Process): if skip_texts: pytest.skip(', '.join(skip_texts)) + def _after_start(self): + """Adjust some qutebrowser settings after starting.""" + settings = [ + ('ui', 'message-timeout', '0'), + ('network', 'ssl-strict', 'false'), + ] + for sect, opt, value in settings: + self.set_setting(sect, opt, value) + def after_test(self, did_fail): """Handle unexpected/skip logging and clean up after each test. diff --git a/tests/end2end/fixtures/testprocess.py b/tests/end2end/fixtures/testprocess.py index 8936e528d..5e514bb85 100644 --- a/tests/end2end/fixtures/testprocess.py +++ b/tests/end2end/fixtures/testprocess.py @@ -239,6 +239,7 @@ class Process(QObject): raise ProcessExited() if blocker.signal_triggered: + self._after_start() return raise WaitForTimeout("Timed out while waiting for process start.") @@ -268,6 +269,10 @@ class Process(QObject): assert ok assert self.is_running() + def _after_start(self): + """Do things which should be done immediately after starting.""" + pass + def before_test(self): """Restart process before a test if it exited before.""" self._invalid = []