Skip to content

Commit 9022641

Browse files
authored
style: black format
1 parent 8c9eb27 commit 9022641

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation_wrapped.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ def test_render_path_parameters(self):
7979
spans = self.memory_exporter.get_finished_spans()
8080
expected_span_name = "GET /foobar"
8181
self.assertEqual(
82-
spans[0].name, 'GET /foobar',
83-
f"Expected span name to be '{expected_span_name}', but got '{spans[0].name}'"
82+
spans[0].name,
83+
"GET /foobar",
84+
f"Expected span name to be '{expected_span_name}', but got '{spans[0].name}'",
8485
)
8586

8687
# Make a request to the endpoint with a path parameter
@@ -99,13 +100,15 @@ def test_render_path_parameters(self):
99100

100101
# Verify that the path parameter is rendered correctly
101102
self.assertIn("http.route", server_span.attributes)
102-
self.assertEqual(server_span.attributes["http.route"],
103-
"/user/{username}")
103+
self.assertEqual(
104+
server_span.attributes["http.route"], "/user/{username}"
105+
)
104106

105107
# Optionally, check if the username is also included in the span attributes
106108
self.assertIn("http.path_parameters.username", server_span.attributes)
107109
self.assertEqual(
108-
server_span.attributes["http.path_parameters.username"], "johndoe")
110+
server_span.attributes["http.path_parameters.username"], "johndoe"
111+
)
109112

110113
# Retrieve the spans generated
111114
spans = self.memory_exporter.get_finished_spans()
@@ -114,8 +117,11 @@ def test_render_path_parameters(self):
114117
self.assertGreater(len(spans), 0, "No spans were generated.")
115118

116119
# Assert that the span name is as expected
117-
expected_span_name = "GET /user/johndoe" # Adjust this based on your implementation
120+
expected_span_name = (
121+
"GET /user/johndoe" # Adjust this based on your implementation
122+
)
118123
self.assertEqual(
119-
spans[0].name, expected_span_name,
120-
f"Expected span name to be '{expected_span_name}', but got '{spans[0].name}'"
124+
spans[0].name,
125+
expected_span_name,
126+
f"Expected span name to be '{expected_span_name}', but got '{spans[0].name}'",
121127
)

0 commit comments

Comments
 (0)