本文整理汇总了Python中_pytest.terminal.TerminalReporter.pytest_collectreport方法的典型用法代码示例。如果您正苦于以下问题:Python TerminalReporter.pytest_collectreport方法的具体用法?Python TerminalReporter.pytest_collectreport怎么用?Python TerminalReporter.pytest_collectreport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_pytest.terminal.TerminalReporter
的用法示例。
在下文中一共展示了TerminalReporter.pytest_collectreport方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pytest_collectreport
# 需要导入模块: from _pytest.terminal import TerminalReporter [as 别名]
# 或者: from _pytest.terminal.TerminalReporter import pytest_collectreport [as 别名]
def pytest_collectreport(self, report):
TerminalReporter.pytest_collectreport(self, report)
if report.location[0]:
self.paths_left.append(os.path.join(os.getcwd(), report.location[0]))
if report.failed:
self.rewrite("")
self.print_failure(report)
示例2: pytest_collectreport
# 需要导入模块: from _pytest.terminal import TerminalReporter [as 别名]
# 或者: from _pytest.terminal.TerminalReporter import pytest_collectreport [as 别名]
def pytest_collectreport(self, report):
"""Report failure during colltion.
:type report: :py:class:_pytest.runner.CollectReport
"""
TerminalReporter.pytest_collectreport(self, report)
if report.failed:
self.report_failure(report, when='collect')