MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_trace_scope

Function test_trace_scope

dali/test/python/operator_1/test_operator_origin_trace.py:145–162  ·  view source on GitHub ↗
(test_mode)

Source from the content-addressed store, hash-verified

143
144@params(*test_modes)
145def test_trace_scope(test_mode):
146 global op_mode
147 op_mode = test_mode
148
149 pipe = Pipeline(batch_size=2, num_threads=1, device_id=0)
150
151 with pipe:
152 pipe.set_outputs(origin_trace())
153
154 dali_tbs = capture_dali_traces(lambda: pipe)
155
156 glob = f""" File "*/test_operator_origin_trace.py", line *, in test_trace_scope
157 pipe.set_outputs(origin_trace())
158 File "*/test_operator_origin_trace.py", line *, in origin_trace
159 return {"fn.origin_trace_dump()" if test_mode == "dali.fn" else "ops.OriginTraceDump()()"}*
160"""
161 regex = fnmatch.translate(glob)
162 assert re.match(regex, dali_tbs[0]), f"{dali_tbs[0]} didn't match expected traceback"
163
164
165@params(*test_modes)

Callers

nothing calls this directly

Calls 5

set_outputsMethod · 0.95
PipelineClass · 0.90
origin_traceFunction · 0.85
capture_dali_tracesFunction · 0.85
matchMethod · 0.80

Tested by

no test coverage detected