From 0ed11817c197f045ef7a5f82cc9fb33a4d5f1657 Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 30 Jan 2018 13:30:31 +0100 Subject: [PATCH] restore coverage: no cover for normally unreachable scopes (only if test cases failed) --- fail2ban/tests/fail2banclienttestcase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fail2ban/tests/fail2banclienttestcase.py b/fail2ban/tests/fail2banclienttestcase.py index e346f09d..92e08bfc 100644 --- a/fail2ban/tests/fail2banclienttestcase.py +++ b/fail2ban/tests/fail2banclienttestcase.py @@ -373,7 +373,7 @@ class Fail2banClientServerBase(LogCaptureTestCase): sock = pjoin(tmp, "f2b.sock") # wait for server (socket): 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( 'Unexpected: Socket file does not exists.\nStart failed: %r' % (startparams,) @@ -381,7 +381,7 @@ class Fail2banClientServerBase(LogCaptureTestCase): if ready: # wait for communication with worker ready: 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( 'Unexpected: Server ready was not found.\nStart failed: %r' % (startparams,)