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.
This commit is contained in:
Florian Bruhin 2016-05-29 23:32:22 +02:00
parent 6ec6657641
commit d385206ea0
2 changed files with 14 additions and 0 deletions

View File

@ -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.

View File

@ -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 = []