Skip to content

Commit bd0e2aa

Browse files
committed
Fix unit tests
1 parent 34c5887 commit bd0e2aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

reframe/core/logging.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ def __init__(self, fmt=None, datefmt=None, perffmt=None,
305305

306306
self.__fmt = fmt
307307
self.__fmtperf = perffmt[:-1] if perffmt else ''
308+
self.__specs = re.findall(r'\%\((\S+?)\)s', fmt)
308309
self.__delim = perffmt[-1] if perffmt else ''
309310
self.__expand_vars = '%(check_#ALL)s' in self.__fmt
310311
self.__expanded_fmt = {}
@@ -349,6 +350,10 @@ def _format_perf(self, perfvars):
349350

350351
def formatMessage(self, record):
351352
fmt = self._expand_fmt(record)
353+
for s in self.__specs:
354+
if s != 'check_#ALL' and not hasattr(record, s):
355+
setattr(record, s, None)
356+
352357
record_proxy = dict(record.__dict__)
353358
for k, v in record_proxy.items():
354359
if k == 'check_perfvalues':

0 commit comments

Comments
 (0)