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

Function test_traceback

library/python/runtime_py3/test/test_traceback.py:30–65  ·  view source on GitHub ↗
(mode, entry_point)

Source from the content-addressed store, hash-verified

28 ],
29)
30def test_traceback(mode, entry_point):
31 tb_tool = yc.build_path("library/python/runtime_py3/test/traceback/traceback")
32 stdout_path = yc.test_output_path("stdout_raw.txt")
33 stderr_path = yc.test_output_path("stderr_raw.txt")
34 filtered_stdout_path = yc.test_output_path("stdout.txt")
35 filtered_stderr_path = yc.test_output_path("stderr.txt")
36
37 env = os.environ.copy()
38 env.pop("PYTHONPATH", None) # Do not let program peek into its sources on filesystem
39 if entry_point == "custom":
40 env["Y_PYTHON_ENTRY_POINT"] = "library.python.runtime_py3.test.traceback.crash:main"
41
42 proc = yc.execute(
43 command=[tb_tool, mode],
44 env=env,
45 stdout=stdout_path,
46 stderr=stderr_path,
47 check_exit_code=False,
48 )
49
50 with open(filtered_stdout_path, "wb") as f:
51 f.write(clean_traceback(proc.std_out))
52
53 with open(filtered_stderr_path, "wb") as f:
54 f.write(clean_traceback(proc.std_err))
55
56 return {
57 "stdout": yc.canonical_file(
58 filtered_stdout_path,
59 local=True,
60 ),
61 "stderr": yc.canonical_file(
62 filtered_stderr_path,
63 local=True,
64 ),
65 }

Callers

nothing calls this directly

Calls 6

clean_tracebackFunction · 0.85
openFunction · 0.50
copyMethod · 0.45
popMethod · 0.45
executeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected