no cover for sporadic executed (time-related) code pieces (just to prevent randomly increasing/decreasing of coverage)

pull/1619/head
sebres 2016-11-22 17:38:32 +01:00
parent fdac44ca58
commit 8ed5b44bfd
3 changed files with 3 additions and 3 deletions

View File

@ -125,7 +125,7 @@ class Fail2banClient(Fail2banCmdLine, Thread):
if client: if client:
try : try :
client.close() client.close()
except Exception as e: except Exception as e: # pragma: no cover
if showRet or self._conf["verbose"] > 1: if showRet or self._conf["verbose"] > 1:
logSys.debug(e) logSys.debug(e)
if showRet or c[0] == 'echo': if showRet or c[0] == 'echo':

View File

@ -241,7 +241,7 @@ class AsyncServer(asyncore.dispatcher):
def _remove_sock(self): def _remove_sock(self):
try: try:
os.remove(self.__sock) os.remove(self.__sock)
except OSError as e: except OSError as e: # pragma: no cover
if e.errno != errno.ENOENT: if e.errno != errno.ENOENT:
raise raise

View File

@ -170,7 +170,7 @@ class Utils():
time.sleep(Utils.DEFAULT_SLEEP_INTERVAL) time.sleep(Utils.DEFAULT_SLEEP_INTERVAL)
retcode = popen.poll() retcode = popen.poll()
#logSys.debug("%s -- killed %s ", realCmd, retcode) #logSys.debug("%s -- killed %s ", realCmd, retcode)
if retcode is None and not Utils.pid_exists(pgid): if retcode is None and not Utils.pid_exists(pgid): # pragma: no cover
retcode = signal.SIGKILL retcode = signal.SIGKILL
except OSError as e: except OSError as e:
stderr = "%s -- failed with %s" % (realCmd, e) stderr = "%s -- failed with %s" % (realCmd, e)