tests: Strip [2s ago] markers from log messages.
This commit is contained in:
parent
e1c6cd6c6d
commit
ada4b669bc
@ -108,7 +108,10 @@ class LogLine(testprocess.Line):
|
|||||||
else:
|
else:
|
||||||
self.line = line
|
self.line = line
|
||||||
|
|
||||||
self.message = match.group('message')
|
msg_match = re.match(r'^(\[(?P<prefix>\d+s ago)\] )?(?P<message>.*)',
|
||||||
|
match.group('message'))
|
||||||
|
self.prefix = msg_match.group('prefix')
|
||||||
|
self.message = msg_match.group('message')
|
||||||
|
|
||||||
self.expected = is_ignored_qt_message(self.message)
|
self.expected = is_ignored_qt_message(self.message)
|
||||||
|
|
||||||
|
@ -99,6 +99,11 @@ def test_qt_log_ignore(qtbot, quteproc):
|
|||||||
'line': 233,
|
'line': 233,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
# With [2s ago] marker
|
||||||
|
'00:00:00 DEBUG foo foo:foo:0 [2s ago] test',
|
||||||
|
{'prefix': '2s ago', 'message': 'test'}
|
||||||
|
),
|
||||||
])
|
])
|
||||||
def test_log_line_parse(data, attrs):
|
def test_log_line_parse(data, attrs):
|
||||||
line = quteprocess.LogLine(data)
|
line = quteprocess.LogLine(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user