(item, call)
| 594 | |
| 595 | @pytest.hookimpl(hookwrapper=True) |
| 596 | def pytest_runtest_makereport(item, call): |
| 597 | def logreport(report, result, call, markers): |
| 598 | test_item = TestItem(report, item.location[0], result, pytest_config.option.test_suffix, markers=markers) |
| 599 | if not pytest_config.suite_metrics and context.Ctx.get("YA_PYTEST_START_TIMESTAMP"): |
| 600 | pytest_config.suite_metrics["pytest_startup_duration"] = call.start - context.Ctx["YA_PYTEST_START_TIMESTAMP"] |
| 601 | pytest_config.ya_trace_reporter.dump_suite_metrics() |
| 602 | |
| 603 | pytest_config.ya_trace_reporter.on_log_report(test_item) |
| 604 | |
| 605 | if report.outcome == "failed": |
| 606 | yatest_logger.error(report.longrepr) |
| 607 | |
| 608 | if report.when == "call": |
| 609 | _collect_test_rusage(item) |
| 610 | pytest_config.ya_trace_reporter.on_finish_test_case(test_item) |
| 611 | elif report.when == "setup": |
| 612 | pytest_config.ya_trace_reporter.on_start_test_class(test_item) |
| 613 | if report.outcome != "passed": |
| 614 | pytest_config.ya_trace_reporter.on_start_test_case(test_item) |
| 615 | pytest_config.ya_trace_reporter.on_finish_test_case(test_item) |
| 616 | else: |
| 617 | pytest_config.ya_trace_reporter.on_start_test_case(test_item) |
| 618 | elif report.when == "teardown": |
| 619 | if report.outcome == "failed": |
| 620 | pytest_config.ya_trace_reporter.on_start_test_case(test_item) |
| 621 | pytest_config.ya_trace_reporter.on_finish_test_case(test_item) |
| 622 | else: |
| 623 | pytest_config.ya_trace_reporter.on_finish_test_case(test_item, duration_only=True) |
| 624 | pytest_config.ya_trace_reporter.on_finish_test_class(test_item) |
| 625 | |
| 626 | outcome = yield |
| 627 | rep = outcome.get_result() |
| 628 | result = None |
| 629 | if hasattr(item, 'retval') and item.retval is not None: |
| 630 | result = item.retval |
| 631 | if not pytest_config.from_ya_test: |
| 632 | ti = TestItem(rep, item.location[0], result, pytest_config.option.test_suffix) |
| 633 | tr = pytest_config.pluginmanager.getplugin('terminalreporter') |
| 634 | tr.write_line("{} - Validating canonical data is not supported when running standalone binary".format(ti), yellow=True, bold=True) |
| 635 | logreport(rep, result, call, item.own_markers) |
| 636 | |
| 637 | |
| 638 | def pytest_make_parametrize_id(config, val, argname): |
nothing calls this directly
no test coverage detected