Skip to content

Commit c112f99

Browse files
committed
Fix linting.
1 parent f04f046 commit c112f99

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -900,12 +900,10 @@ async def test_user_agent_synthetic_bot_detection(self):
900900
# Clear headers first
901901
self.scope["headers"] = []
902902

903-
def update_expected_synthetic_bot(expected):
903+
def update_expected_synthetic_bot(expected, ua=user_agent):
904904
expected[3]["attributes"].update(
905905
{
906-
SpanAttributes.HTTP_USER_AGENT: user_agent.decode(
907-
"utf8"
908-
),
906+
SpanAttributes.HTTP_USER_AGENT: ua.decode("utf8"),
909907
USER_AGENT_SYNTHETIC_TYPE: "bot",
910908
}
911909
)
@@ -933,12 +931,10 @@ async def test_user_agent_synthetic_test_detection(self):
933931
# Clear headers first
934932
self.scope["headers"] = []
935933

936-
def update_expected_synthetic_test(expected):
934+
def update_expected_synthetic_test(expected, ua=user_agent):
937935
expected[3]["attributes"].update(
938936
{
939-
SpanAttributes.HTTP_USER_AGENT: user_agent.decode(
940-
"utf8"
941-
),
937+
SpanAttributes.HTTP_USER_AGENT: ua.decode("utf8"),
942938
USER_AGENT_SYNTHETIC_TYPE: "test",
943939
}
944940
)
@@ -967,13 +963,11 @@ async def test_user_agent_non_synthetic(self):
967963
# Clear headers first
968964
self.scope["headers"] = []
969965

970-
def update_expected_non_synthetic(expected):
966+
def update_expected_non_synthetic(expected, ua=user_agent):
971967
# Should only have the user agent, not synthetic type
972968
expected[3]["attributes"].update(
973969
{
974-
SpanAttributes.HTTP_USER_AGENT: user_agent.decode(
975-
"utf8"
976-
),
970+
SpanAttributes.HTTP_USER_AGENT: ua.decode("utf8"),
977971
}
978972
)
979973
return expected

instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ def test_default_span_name_missing_path_info(self):
530530
self.validate_response(response, span_name=method)
531531

532532

533+
# pylint: disable=too-many-public-methods
533534
class TestWsgiAttributes(unittest.TestCase):
534535
def setUp(self):
535536
self.environ = {}

0 commit comments

Comments
 (0)