mirror of https://github.com/fail2ban/fail2ban
amend to bcf557990e15922aff22485cc86ddd2fcf41b796: wrong logging syntax will not throw an error anymore (logged now, as logging is safe)
parent
bcf557990e
commit
73e89df912
|
@ -416,13 +416,10 @@ class TestsUtilsTest(LogCaptureTestCase):
|
||||||
|
|
||||||
def testLazyLogging(self):
|
def testLazyLogging(self):
|
||||||
logSys = DefLogSys
|
logSys = DefLogSys
|
||||||
if unittest.F2B.log_lazy:
|
logSys.debug('lazy logging: %r', unittest.F2B.log_lazy)
|
||||||
# wrong logging syntax will throw an error lazy (on demand):
|
# wrong logging syntax will don't throw an error anymore (logged now):
|
||||||
logSys.debug('test', 1, 2, 3)
|
logSys.notice('test', 1, 2, 3)
|
||||||
self.assertRaisesRegexp(Exception, 'not all arguments converted', lambda: self.assertNotLogged('test'))
|
self.assertLogged('not all arguments converted')
|
||||||
else: # pragma: no cover
|
|
||||||
# wrong logging syntax will throw an error directly:
|
|
||||||
self.assertRaisesRegexp(Exception, 'not all arguments converted', lambda: logSys.debug('test', 1, 2, 3))
|
|
||||||
|
|
||||||
|
|
||||||
class MyTimeTest(unittest.TestCase):
|
class MyTimeTest(unittest.TestCase):
|
||||||
|
|
Loading…
Reference in New Issue