From 0c5f11079c6d1cb817a4218f707be37cd1897398 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 9 Oct 2014 10:46:17 -0400 Subject: [PATCH] ENH: keep spitting out logging to the screen in LogCaptureTestCases if HEAVYDEBUG --- fail2ban/tests/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fail2ban/tests/utils.py b/fail2ban/tests/utils.py index ad504703..b56c0988 100644 --- a/fail2ban/tests/utils.py +++ b/fail2ban/tests/utils.py @@ -25,6 +25,7 @@ __license__ = "GPL" import logging import os import re +import sys import time import unittest from StringIO import StringIO @@ -205,6 +206,8 @@ class LogCaptureTestCase(unittest.TestCase): # Let's log everything into a string self._log = StringIO() logSys.handlers = [logging.StreamHandler(self._log)] + if self._old_level < logging.DEBUG: # so if HEAVYDEBUG etc -- show them! + logSys.handlers += self._old_handlers logSys.setLevel(getattr(logging, 'DEBUG')) def tearDown(self):