CapturingLogHandler: match the fully formatted log message in assertRegex
and not the raw 'msg' attribute which still has the '%' formatting placeholders
This commit is contained in:
parent
bc0480e19e
commit
60f2c741c3
@ -467,7 +467,7 @@ class CapturingLogHandler(logging.Handler):
|
||||
import re
|
||||
pattern = re.compile(regexp)
|
||||
for r in self.records:
|
||||
if pattern.search(r.msg):
|
||||
if pattern.search(r.getMessage()):
|
||||
return True
|
||||
assert 0, "Pattern '%s' not found in logger records" % regexp
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user