Skip to content

Commit 1578473

Browse files
committed
Check logging of aliased variables
1 parent 09b9cc8 commit 1578473

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

unittests/test_logging.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def fake_check():
2929
class _FakeCheck(rfm.RegressionTest):
3030
param = parameter(range(3), loggable=True, fmt=lambda x: 10*x)
3131
custom = variable(str, value='hello extras', loggable=True)
32+
custom2 = variable(alias=custom)
3233
custom_list = variable(list,
3334
value=['custom', 3.0, ['hello', 'world']],
3435
loggable=True)
@@ -161,13 +162,13 @@ def test_logger_levels(logfile, logger_with_check):
161162

162163
def test_logger_loggable_attributes(logfile, logger_with_check):
163164
formatter = rlog.RFC3339Formatter(
164-
'%(check_custom)s|%(check_custom_list)s|'
165+
'%(check_custom)s|%(check_custom2)s|%(check_custom_list)s|'
165166
'%(check_foo)s|%(check_custom_dict)s|%(check_param)s|%(check_x)s'
166167
)
167168
logger_with_check.logger.handlers[0].setFormatter(formatter)
168169
logger_with_check.info('xxx')
169170
assert _pattern_in_logfile(
170-
r'hello extras\|custom,3.0,\["hello", "world"\]\|null\|'
171+
r'hello extras\|null\|custom,3.0,\["hello", "world"\]\|null\|'
171172
r'{"a": 1, "b": 2}\|10\|null', logfile
172173
)
173174

0 commit comments

Comments
 (0)