mirror of https://github.com/fail2ban/fail2ban
restore coverage: no cover for normally unreachable scopes (only if test cases failed)
parent
0be0e43d47
commit
0ed11817c1
|
@ -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,)
|
||||||
|
|
Loading…
Reference in New Issue