Skip to content

Commit 97711a1

Browse files
Nikita VoronchevNikita Voronchev
authored andcommitted
Primitive logging of PyTest exception messages
1 parent cba9546 commit 97711a1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pytest_reportportal/plugin.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import pytest
21
# This program is free software: you can redistribute it
32
# and/or modify it under the terms of the GPL licence
3+
44
import logging
5+
import html
6+
7+
import pytest
8+
59
from .service import PyTestService
610

711

@@ -17,6 +21,10 @@ class RP_Report_Listener(object):
1721
@pytest.mark.hookwrapper
1822
def pytest_runtest_makereport(self, item, call):
1923
report = (yield).get_result()
24+
25+
if report.longrepr:
26+
PyTestService.post_log(html.escape(str(report.longrepr)), logging.ERROR)
27+
2028
if report.when == "setup":
2129

2230
# when function pytest_setup is called,

0 commit comments

Comments
 (0)