Exemplo n.º 1
0
 def test_close_span(self):
     # it should keep track of closed spans, moving
     # the current active to it's parent
     ctx = Context()
     span = Span(tracer=None, name='fake_span')
     ctx.add_span(span)
     ctx.close_span(span)
     assert ctx.get_current_span() is None
Exemplo n.º 2
0
 def test_current_span(self):
     # it should return the current active span
     ctx = Context()
     span = Span(tracer=None, name='fake_span')
     ctx.add_span(span)
     assert span == ctx.get_current_span()