예제 #1
0
 def __init__(self, nodeid, test_suffix):
     self._result = None
     self.nodeid = nodeid
     self._class_name, self._test_name = tools.split_node_id(nodeid, test_suffix)
     self._duration = 0
     self._error = ""
     self._keywords = {}
예제 #2
0
 def __init__(self, report, result, test_suffix):
     self._result = result
     self.nodeid = report.nodeid
     self._class_name, self._test_name = tools.split_node_id(self.nodeid, test_suffix)
     self._error = None
     self._status = None
     self._process_report(report)
     self._duration = hasattr(report, 'duration') and report.duration or 0
     self._keywords = getattr(report, "keywords", {})
예제 #3
0
파일: ya.py 프로젝트: soprof/catboost
def pytest_runtest_setup(item):
    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)