MCPcopy
hub / github.com/evalplus/evalplus / safety_test

Function safety_test

tools/_experimental/evaluate_coverage.py:83–92  ·  view source on GitHub ↗
(code: str, inputs: List[List[Any]], entry_point: str)

Source from the content-addressed store, hash-verified

81 code: str, inputs: List[List[Any]], entry_point: str, mode="branch"
82):
83 def safety_test(code: str, inputs: List[List[Any]], entry_point: str):
84 for input_list in inputs:
85 code += f"{entry_point}({construct_inputs_sig(input_list)})\n"
86 reliability_guard()
87 try:
88 with swallow_io():
89 with time_limit(1):
90 exec(code, {})
91 except:
92 sys.exit(1)
93
94 p = multiprocessing.Process(target=safety_test, args=(code, inputs, entry_point))
95 p.start()

Callers

nothing calls this directly

Calls 4

reliability_guardFunction · 0.90
swallow_ioFunction · 0.90
time_limitFunction · 0.90
construct_inputs_sigFunction · 0.85

Tested by

no test coverage detected