def pytest_runtest_call(__multicall__, item): """hook to run each test with traced function calls""" if item.config.getvalue('tracer'): out = art_client.fire_hook('filedump', grab_result=True, test_name=item.name, test_location=item.parent.name, filename="function_trace.txt", contents="", fd_ident="func_trace") if out: filename = os.path.join(out['artifact_path'], 'filedump-function_trace.txt') else: filename = './tracelogs/' + item.name.replace("/", "_") with function_trace.trace_on( tracer=function_trace.PerThreadFileTracer( to_trace, depths=depths, filename=filename)): __multicall__.execute()
def pytest_runtest_call(item): """hook to run each test with traced function calls""" if item.config.getvalue('tracer'): out = art_client.fire_hook('filedump', grab_result=True, test_name=item.name, test_location=item.parent.name, description="Function trace", contents="", file_type="func_trace", group_id="misc-artifacts") if out: filename = os.path.join(out['artifact_path'], 'filedump-function_trace.txt') else: filename = './tracelogs/' + item.name.replace("/", "_") with function_trace.trace_on( tracer=function_trace.PerThreadFileTracer( to_trace, depths=depths, filename=filename)): yield else: yield
def pytest_runtest_call(item): """hook to run each test with traced function calls""" if item.config.getvalue('tracer'): out = art_client.fire_hook('filedump', grab_result=True, test_name=item.name, test_location=item.parent.name, filename="function_trace.txt", contents="", fd_ident="func_trace") if out: filename = os.path.join(out['artifact_path'], 'filedump-function_trace.txt') else: filename = './tracelogs/' + item.name.replace("/", "_") with function_trace.trace_on(tracer=function_trace.PerThreadFileTracer( to_trace, depths=depths, filename=filename)): yield else: yield
def trace_on(): with function_trace.trace_on( tracer=function_trace.StdoutTracer(to_trace, depths=depths)): yield
def trace_on(): with function_trace.trace_on( tracer=function_trace.StdoutTracer( to_trace, depths=depths)): yield