Skip to content

Commit

Permalink
style: fix black warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jagerzhang authored Oct 18, 2024
1 parent de4f3d7 commit 8c9eb27
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ async def _(username: str):
return {"username": username}

otel_fastapi.FastAPIInstrumentor().instrument_app(
self.app, render_path_parameters=True)
self.app, render_path_parameters=True
)
self.client = TestClient(self.app)
self.tracer = self.tracer_provider.get_tracer(__name__)

Expand All @@ -46,7 +47,8 @@ def tearDown(self) -> None:

def test_mark_span_internal_in_presence_of_span_from_other_framework(self):
with self.tracer.start_as_current_span(
"test", kind=trace.SpanKind.SERVER) as parent_span:
"test", kind=trace.SpanKind.SERVER
) as parent_span:
resp = self.client.get("/foobar")
self.assertEqual(200, resp.status_code)

Expand All @@ -59,12 +61,14 @@ def test_mark_span_internal_in_presence_of_span_from_other_framework(self):
self.assertEqual(trace.SpanKind.INTERNAL, span_list[1].kind)
# main INTERNAL span - child of test
self.assertEqual(trace.SpanKind.INTERNAL, span_list[2].kind)
self.assertEqual(parent_span.context.span_id,
span_list[2].parent.span_id)
self.assertEqual(
parent_span.context.span_id, span_list[2].parent.span_id
)
# SERVER "test"
self.assertEqual(trace.SpanKind.SERVER, span_list[3].kind)
self.assertEqual(parent_span.context.span_id,
span_list[3].context.span_id)
self.assertEqual(
parent_span.context.span_id, span_list[3].context.span_id
)

def test_render_path_parameters(self):
"""Test that path parameters are rendered correctly in spans."""
Expand Down

0 comments on commit 8c9eb27

Please sign in to comment.