Skip to content

Commit a804860

Browse files
author
xiaochen.sun
committed
Send error log after the test item session started.
Fix #30
1 parent e61f26a commit a804860

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pytest_reportportal/plugin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ class RP_Report_Listener(object):
2222
def pytest_runtest_makereport(self, item, call):
2323
report = (yield).get_result()
2424

25+
if report.when == "setup":
26+
# when function pytest_setup is called,
27+
# test item session will be started in RP
28+
PyTestService.start_pytest_item(item)
29+
2530
if report.longrepr:
2631
PyTestService.post_log(
2732
cgi.escape(report.longreprtext),
2833
loglevel='ERROR',
2934
)
3035

31-
if report.when == "setup":
32-
# when function pytest_setup is called,
33-
# test item session will be started in RP
34-
PyTestService.start_pytest_item(item)
35-
3636
if report.when == "call":
3737
self.called = True
3838
if report.passed:

0 commit comments

Comments
 (0)