示例#1
0
文件: ya.py 项目: blockspacer/xtok
def pytest_runtest_setup(item):
    item.rusage = _get_rusage()
    pytest.config.test_cores_count = 0
    pytest.config.current_item_nodeid = item.nodeid
    class_name, test_name = tools.split_node_id(item.nodeid)
    test_log_path = tools.get_test_log_file_path(pytest.config.ya.output_dir,
                                                 class_name, test_name)
    setup_logging(os.path.join(pytest.config.ya.output_dir, "run.log"),
                  pytest.config.option.test_log_level, test_log_path)
    pytest.config.test_logs[item.nodeid]['log'] = test_log_path
    pytest.config.test_logs[
        item.nodeid]['logsdir'] = pytest.config.ya.output_dir
    pytest.config.current_test_log_path = test_log_path
    pytest.config.current_test_name = "{}::{}".format(class_name, test_name)
    separator = "#" * 100
    yatest_logger.info(separator)
    yatest_logger.info(test_name)
    yatest_logger.info(separator)
    yatest_logger.info("Test setup")

    test_item = CrashedTestItem(item.nodeid, pytest.config.option.test_suffix)
    pytest.config.ya_trace_reporter.on_start_test_class(test_item)
    pytest.config.ya_trace_reporter.on_start_test_case(test_item)
示例#2
0
文件: ya.py 项目: iamnik13/catboost
def pytest_runtest_setup(item):
    item.rusage = _get_rusage()
    pytest.config.test_cores_count = 0
    pytest.config.current_item_nodeid = item.nodeid
    class_name, test_name = tools.split_node_id(item.nodeid)
    test_log_path = tools.get_test_log_file_path(pytest.config.ya.output_dir, class_name, test_name)
    setup_logging(
        os.path.join(pytest.config.ya.output_dir, "run.log"),
        pytest.config.option.test_log_level,
        test_log_path
    )
    pytest.config.test_logs[item.nodeid]['log'] = test_log_path
    pytest.config.test_logs[item.nodeid]['logsdir'] = pytest.config.ya.output_dir
    pytest.config.current_test_log_path = test_log_path
    pytest.config.current_test_name = "{}::{}".format(class_name, test_name)
    separator = "#" * 100
    yatest_logger.info(separator)
    yatest_logger.info(test_name)
    yatest_logger.info(separator)
    yatest_logger.info("Test setup")

    test_item = CrashedTestItem(item.nodeid, pytest.config.option.test_suffix)
    pytest.config.ya_trace_reporter.on_start_test_class(test_item)
    pytest.config.ya_trace_reporter.on_start_test_case(test_item)