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

Method __init__

library/python/testing/yatest_lib/ya.py:30–130  ·  view source on GitHub ↗
(
        self,
        mode=None,
        source_root=None,
        build_root=None,
        dep_roots=None,
        output_dir=None,
        test_params=None,
        context=None,
        python_path=None,
        valgrind_path=None,
        gdb_path=None,
        data_root=None,
        env_file=None,
        project_path=None,
    )

Source from the content-addressed store, hash-verified

28 """
29
30 def __init__(
31 self,
32 mode=None,
33 source_root=None,
34 build_root=None,
35 dep_roots=None,
36 output_dir=None,
37 test_params=None,
38 context=None,
39 python_path=None,
40 valgrind_path=None,
41 gdb_path=None,
42 data_root=None,
43 env_file=None,
44 project_path=None,
45 ):
46 context_file_path = os.environ.get("YA_TEST_CONTEXT_FILE", None)
47 if context_file_path:
48 with open(context_file_path, 'r') as afile:
49 test_context = json.load(afile)
50 if six.PY2:
51 from library.python.strings import ensure_str_deep
52 test_context = ensure_str_deep(test_context)
53 context_runtime = test_context["runtime"]
54 context_internal = test_context.get("internal", {})
55 context_build = test_context.get("build", {})
56 context_resources = test_context.get("resources", {})
57 else:
58 context_runtime = {}
59 context_internal = {}
60 context_build = {}
61 context_resources = {}
62 self._mode = mode
63 self._build_root = to_str(context_runtime.get("build_root", "")) or build_root
64 self._source_root = to_str(context_runtime.get("source_root", "")) or source_root or self._detect_source_root()
65 self._output_dir = to_str(context_runtime.get("output_path", "")) or output_dir or self._detect_output_root()
66 if not self._output_dir:
67 raise Exception("Run ya make -t before running test binary")
68 if not self._source_root:
69 logging.warning("Source root was not set neither determined, use --source-root to set it explicitly")
70 if not self._build_root:
71 if self._source_root:
72 self._build_root = self._source_root
73 else:
74 logging.warning("Build root was not set neither determined, use --build-root to set it explicitly")
75
76 if data_root:
77 self._data_root = data_root
78 elif self._source_root:
79 self._data_root = os.path.abspath(os.path.join(self._source_root, "..", "arcadia_tests_data"))
80
81 self._dep_roots = dep_roots
82
83 self._python_path = to_str(context_runtime.get("python_bin", "")) or python_path
84 self._valgrind_path = valgrind_path
85 self._gdb_path = to_str(context_runtime.get("gdb_bin", "")) or gdb_path
86 self._test_params = {}
87 self._context = {}

Callers

nothing calls this directly

Calls 15

_detect_source_rootMethod · 0.95
_detect_output_rootMethod · 0.95
ensure_str_deepFunction · 0.90
dictClass · 0.85
warningMethod · 0.80
to_strFunction · 0.70
openFunction · 0.50
strClass · 0.50
getMethod · 0.45
loadMethod · 0.45
joinMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected