bdd: Fix parsing of logged python warnings
This commit is contained in:
parent
dc1b0920ab
commit
e3f1949f57
@ -69,7 +69,7 @@ class LogLine(testprocess.Line):
|
|||||||
LOG_RE = re.compile(r"""
|
LOG_RE = re.compile(r"""
|
||||||
(?P<timestamp>\d\d:\d\d:\d\d)
|
(?P<timestamp>\d\d:\d\d:\d\d)
|
||||||
\ (?P<loglevel>VDEBUG|DEBUG|INFO|WARNING|ERROR)
|
\ (?P<loglevel>VDEBUG|DEBUG|INFO|WARNING|ERROR)
|
||||||
\ +(?P<category>\w+)
|
\ +(?P<category>[\w.]+)
|
||||||
\ +(?P<module>(\w+|Unknown\ module)):
|
\ +(?P<module>(\w+|Unknown\ module)):
|
||||||
(?P<function>[^"][^:]*|"[^"]+"):
|
(?P<function>[^"][^:]*|"[^"]+"):
|
||||||
(?P<line>\d+)
|
(?P<line>\d+)
|
||||||
|
@ -146,8 +146,16 @@ def test_quteprocess_quitting(qtbot, quteproc_process):
|
|||||||
'00:00:00 DEBUG foo foo:foo:0 [2s ago] test',
|
'00:00:00 DEBUG foo foo:foo:0 [2s ago] test',
|
||||||
{'prefix': '2s ago', 'message': 'test'}
|
{'prefix': '2s ago', 'message': 'test'}
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
# ResourceWarning
|
||||||
|
"00:00:00 WARNING py.warnings app:qt_mainloop:121 "
|
||||||
|
".../app.py:121: ResourceWarning: unclosed file <_io.TextIOWrapper "
|
||||||
|
"name=18 mode='r' encoding='UTF-8'>",
|
||||||
|
{'category': 'py.warnings'}
|
||||||
|
),
|
||||||
], ids=['normal', 'vdebug', 'unknown module', 'expected message',
|
], ids=['normal', 'vdebug', 'unknown module', 'expected message',
|
||||||
'weird Qt location', 'QXcbXSettings', '2s ago marker'])
|
'weird Qt location', 'QXcbXSettings', '2s ago marker',
|
||||||
|
'resourcewarning'])
|
||||||
def test_log_line_parse(data, attrs):
|
def test_log_line_parse(data, attrs):
|
||||||
line = quteprocess.LogLine(data)
|
line = quteprocess.LogLine(data)
|
||||||
for name, expected in attrs.items():
|
for name, expected in attrs.items():
|
||||||
|
Loading…
Reference in New Issue
Block a user