restore coverage: no cover for normally unreachable scopes (only if test cases failed)

pull/2034/head
sebres 2018-01-30 13:30:31 +01:00
parent 0be0e43d47
commit 0ed11817c1
1 changed files with 2 additions and 2 deletions

View File

@ -373,7 +373,7 @@ class Fail2banClientServerBase(LogCaptureTestCase):
sock = pjoin(tmp, "f2b.sock") sock = pjoin(tmp, "f2b.sock")
# wait for server (socket): # wait for server (socket):
ret = Utils.wait_for(lambda: phase.get('end') or exists(sock), MAX_WAITTIME) ret = Utils.wait_for(lambda: phase.get('end') or exists(sock), MAX_WAITTIME)
if not ret or phase.get('end'): if not ret or phase.get('end'): # pragma: no cover - test-failure case only
raise Exception( raise Exception(
'Unexpected: Socket file does not exists.\nStart failed: %r' 'Unexpected: Socket file does not exists.\nStart failed: %r'
% (startparams,) % (startparams,)
@ -381,7 +381,7 @@ class Fail2banClientServerBase(LogCaptureTestCase):
if ready: if ready:
# wait for communication with worker ready: # wait for communication with worker ready:
ret = Utils.wait_for(lambda: "Server ready" in self.getLog(), MAX_WAITTIME) ret = Utils.wait_for(lambda: "Server ready" in self.getLog(), MAX_WAITTIME)
if not ret: if not ret: # pragma: no cover - test-failure case only
raise Exception( raise Exception(
'Unexpected: Server ready was not found.\nStart failed: %r' 'Unexpected: Server ready was not found.\nStart failed: %r'
% (startparams,) % (startparams,)