pytest_collectstart(collector: Collector) ? 收集器開始收集。
pytest_make_collect_report(collector: Collector) ? 執行collector.collect()并返回一個CollectReport。
pytest_itemcollected(item: Item) ? ?我們剛剛收集了一個測試項目。
pytest_collectreport(report: CollectReport) ?收集器完成收集。
pytest_deselected(items: Sequence[Item]) ? 要求取消選擇的測試項目,例如按關鍵字。
pytest_report_header(config: Config, startdir: py._path.local.LocalPath) ?返回要顯示為標題信息的字符串或字符串列表,以進行終端報告。
pytest_report_collectionfinish(config: Config, startdir: py._path.local.LocalPath, items: Sequence[Item]) 返回成功完成收集后將顯示的字符串或字符串列表。
pytest_report_teststatus(report: Union[CollectReport, TestReport], config: Config) 返回結果類別,簡寫形式和詳細詞以進行狀態報告。
pytest_terminal_summary(terminalreporter: TerminalReporter, exitstatus: ExitCode, config: Config) 在終端摘要報告中添加一個部分。
pytest_fixture_setup(fixturedef: FixtureDef[Any], request: SubRequest) 執行夾具設置執行。
pytest_fixture_post_finalizer(fixturedef: FixtureDef[Any], request: SubRequest) ?在夾具拆除之后但在清除緩存之前調用,因此夾具結果fixturedef.cached_result仍然可用(不是 None)
pytest_warning_captured(warning_message: warnings.WarningMessage, when: Literal[‘config’, ‘collect’, ‘runtest’], item: Optional[Item], location: Optional[Tuple[str, int, str]]) ? ? ?(已棄用)處理內部pytest警告插件捕獲的警告。
pytest_warning_recorded(warning_message: warnings.WarningMessage, when: Literal[‘config’, ‘collect’, ‘runtest’], nodeid: str, location: Optional[Tuple[str, int, str]]) 處理內部pytest警告插件捕獲的警告。
pytest_runtest_logreport(report: TestReport) ?處理項目的_pytest.reports.TestReport每個設置,調用和拆卸運行測試階段產生的結果。
pytest_assertrepr_compare(config: Config, op: str, left: object, right: object) ?返回失敗斷言表達式中的比較的說明。
pytest_assertion_pass(item: Item, lineno: int, orig: str, expl: str) ?(實驗性的)在斷言通過時調用。