def test_trace_function_callable_info(tracked_request):
    traced = trace_function(trace_me, lambda: ("Test/Function", {
        "name": "trace_me"
    }))
    traced()

    span = tracked_request.complete_spans[0]
    assert span.operation == "Test/Function/trace_me"
Ejemplo n.º 2
0
 def compile(*args, **kwargs):
     node = tag_compiler(*args, **kwargs)
     node.render = trace_function(node.render, ("Template/Tag", {"name": name}))
     return node
def test_trace_function_no_name(tracked_request):
    traced = trace_function(trace_me, ("Test/Function", {"name": None}))
    traced()

    span = tracked_request.complete_spans[0]
    assert span.operation == "Test/Function"
def test_trace_function_exception(CallableProxy, tracked_request):
    traced = trace_function(trace_me, lambda: ("Test/Function", {
        "name": "trace_me"
    }))
    assert traced is trace_me  # patching failed