Skip to content

Commit 0aca682

Browse files
black formatter
1 parent f2aa453 commit 0aca682

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py

+25-7
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,18 @@ async def long_response_asgi(scope, receive, send):
119119
],
120120
}
121121
)
122-
await send({"type": "http.response.body", "body": b"*", "more_body": True})
123-
await send({"type": "http.response.body", "body": b"*", "more_body": True})
124-
await send({"type": "http.response.body", "body": b"*", "more_body": True})
125-
await send({"type": "http.response.body", "body": b"*", "more_body": False})
122+
await send(
123+
{"type": "http.response.body", "body": b"*", "more_body": True}
124+
)
125+
await send(
126+
{"type": "http.response.body", "body": b"*", "more_body": True}
127+
)
128+
await send(
129+
{"type": "http.response.body", "body": b"*", "more_body": True}
130+
)
131+
await send(
132+
{"type": "http.response.body", "body": b"*", "more_body": False}
133+
)
126134

127135

128136
async def background_execution_asgi(scope, receive, send):
@@ -142,7 +150,12 @@ async def background_execution_asgi(scope, receive, send):
142150
],
143151
}
144152
)
145-
await send({"type": "http.response.body", "body": b"*", })
153+
await send(
154+
{
155+
"type": "http.response.body",
156+
"body": b"*",
157+
}
158+
)
146159
time.sleep(simulated_background_task_execution_time_s)
147160

148161

@@ -280,7 +293,11 @@ def test_asgi_exc_info(self):
280293
self.validate_outputs(outputs, error=ValueError)
281294

282295
def test_long_response(self):
283-
"""Test that the server span is ended on the final response body message. If the server span is ended early then this test will fail due discrepancies in the expected list of spans and the emitted list of spans."""
296+
"""Test that the server span is ended on the final response body message.
297+
298+
If the server span is ended early then this test will fail due
299+
to discrepancies in the expected list of spans and the emitted list of spans.
300+
"""
284301
app = otel_asgi.OpenTelemetryMiddleware(long_response_asgi)
285302
self.seed_app(app)
286303
self.send_default_request()
@@ -312,7 +329,8 @@ def test_background_execution(self):
312329
print(span_duration_nanos)
313330
self.assertLessEqual(
314331
span_duration_nanos,
315-
simulated_background_task_execution_time_s * 10**9)
332+
simulated_background_task_execution_time_s * 10**9,
333+
)
316334

317335
def test_override_span_name(self):
318336
"""Test that default span_names can be overwritten by our callback function."""

0 commit comments

Comments
 (0)