def pytest_runtest_makereport(self):
report = (yield).get_result()
if report.longrepr:
PyTestService.post_log(
# Used for support python 2.7
cgi.escape(report.longreprtext),
loglevel='ERROR',
)
if report.when == 'setup':
if report.failed:
# This happens for example when a fixture fails to run
# causing the test to error
self.result = 'FAILED'
if report.when == 'call':
if report.passed:
item_result = 'PASSED'
elif report.skipped:
item_result = 'SKIPPED'
else:
item_result = 'FAILED'
self.result = item_result
评论列表
文章目录