MCPcopy Create free account
hub / github.com/catboost/catboost / pytest_runtest_setup

Function pytest_runtest_setup

library/python/pytest/plugins/ya.py:415–438  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

413
414
415def pytest_runtest_setup(item):
416 item.rusage = _get_rusage()
417 pytest_config.test_cores_count = 0
418 pytest_config.current_item_nodeid = item.nodeid
419 class_name, test_name = tools.split_node_id(item.nodeid)
420 test_log_path = tools.get_test_log_file_path(pytest_config.ya.output_dir, class_name, test_name)
421 setup_logging(
422 os.path.join(pytest_config.ya.output_dir, "run.log"),
423 pytest_config.option.test_log_level,
424 test_log_path
425 )
426 pytest_config.test_logs[item.nodeid]['log'] = test_log_path
427 pytest_config.test_logs[item.nodeid]['logsdir'] = pytest_config.ya.output_dir
428 pytest_config.current_test_log_path = test_log_path
429 pytest_config.current_test_name = "{}::{}".format(class_name, test_name)
430 separator = "#" * 100
431 yatest_logger.info(separator)
432 yatest_logger.info(test_name)
433 yatest_logger.info(separator)
434 yatest_logger.info("Test setup")
435
436 test_item = CrashedTestItem(item.nodeid, item.location[0], pytest_config.option.test_suffix)
437 pytest_config.ya_trace_reporter.on_start_test_class(test_item)
438 pytest_config.ya_trace_reporter.on_start_test_case(test_item)
439
440
441def pytest_runtest_teardown(item, nextitem):

Callers

nothing calls this directly

Calls 8

_get_rusageFunction · 0.85
setup_loggingFunction · 0.85
CrashedTestItemClass · 0.85
on_start_test_classMethod · 0.80
on_start_test_caseMethod · 0.80
joinMethod · 0.45
formatMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected