Skip to content

Commit bc70d8a

Browse files
authored
Merge pull request #7 from NVoronchev/LogExceptions
Primitive logging of PyTest exception messages
2 parents 0500d14 + dae2eb5 commit bc70d8a

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 cgi
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(cgi.escape(report.longreprtext), logging.ERROR)
27+
2028
if report.when == "setup":
2129

2230
# when function pytest_setup is called,

0 commit comments

Comments
 (0)