Skip to content

Commit 76600a2

Browse files
joshuahlangJoshua Lang
authored andcommitted
More review feedback
1 parent cc3cdb6 commit 76600a2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ext/opentelemetry-ext-aiohttp-client/src/opentelemetry/ext/aiohttp_client/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def create_trace_config(
116116
117117
Example usage:
118118
119-
.. code-block:: python
119+
.. code:: python
120120
121121
import aiohttp
122122
from opentelemetry.ext.aiohttp_client import create_trace_config
@@ -218,8 +218,7 @@ async def on_request_exception(
218218
_end_trace(trace_config_ctx)
219219

220220
def _trace_config_ctx_factory(**kwargs):
221-
if kwargs.get("trace_request_ctx", None) is None:
222-
kwargs["trace_request_ctx"] = {}
221+
kwargs.setdefault("trace_request_ctx", {})
223222
return types.SimpleNamespace(
224223
span_name=span_name, tracer=tracer, url_filter=url_filter, **kwargs
225224
)

ext/opentelemetry-ext-aiohttp-client/tests/test_aiohttp_client_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def test_url_path_span_name(self):
6363
self.assertEqual(actual, expected)
6464
self.assertIsInstance(actual, str)
6565

66-
# Helper to start an aiohttp test server and send an actual HTTP request to it.
6766
@staticmethod
6867
def _http_request(
6968
trace_config,
@@ -73,6 +72,7 @@ def _http_request(
7372
request_handler: typing.Callable = None,
7473
**kwargs
7574
) -> typing.Tuple[str, int]:
75+
"""Helper to start an aiohttp test server and send an actual HTTP request to it."""
7676
async def do_request():
7777
async def default_handler(unused_request):
7878
return aiohttp.web.Response(status=int(status_code))

0 commit comments

Comments
 (0)