Skip to content

Commit b7b8b9e

Browse files
committed
Fix lint
1 parent 8bc4cb0 commit b7b8b9e

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import asyncio
1616
import contextlib
17+
import sys
1718
import typing
1819
import unittest
1920
import urllib.parse
@@ -116,14 +117,19 @@ def test_status_codes(self):
116117
status_code=status_code,
117118
)
118119

120+
url = f"http://{host}:{port}/test-path?query=param#foobar"
121+
# if python version is < 3.8, then the url will be
122+
if sys.version_info[1] < 8:
123+
url = "http://{host}:{port}/test-path#foobar"
124+
119125
self.assert_spans(
120126
[
121127
(
122128
"GET",
123129
(span_status, None),
124130
{
125131
SpanAttributes.HTTP_METHOD: "GET",
126-
SpanAttributes.HTTP_URL: f"http://{host}:{port}/test-path?query=param#foobar",
132+
SpanAttributes.HTTP_URL: url,
127133
SpanAttributes.HTTP_STATUS_CODE: int(
128134
status_code
129135
),

instrumentation/opentelemetry-instrumentation-aws-lambda/tests/__init__.py

Whitespace-only changes.

instrumentation/opentelemetry-instrumentation-aws-lambda/tests/mocks/__init__.py

Whitespace-only changes.

instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
from typing import Any, Callable, Dict
1818
from unittest import mock
1919

20-
from mocks.api_gateway_http_api_event import (
20+
from tests.mocks.api_gateway_http_api_event import (
2121
MOCK_LAMBDA_API_GATEWAY_HTTP_API_EVENT,
2222
)
23-
from mocks.api_gateway_proxy_event import MOCK_LAMBDA_API_GATEWAY_PROXY_EVENT
23+
from tests.mocks.api_gateway_proxy_event import (
24+
MOCK_LAMBDA_API_GATEWAY_PROXY_EVENT,
25+
)
2426

2527
from opentelemetry.environment_variables import OTEL_PROPAGATORS
2628
from opentelemetry.instrumentation.aws_lambda import (
@@ -103,7 +105,7 @@ def setUp(self):
103105
super().setUp()
104106
self.common_env_patch = mock.patch.dict(
105107
"os.environ",
106-
{_HANDLER: "mocks.lambda_function.handler"},
108+
{_HANDLER: "tests.mocks.lambda_function.handler"},
107109
)
108110
self.common_env_patch.start()
109111

@@ -356,7 +358,7 @@ def test_lambda_handles_multiple_consumers(self):
356358
def test_api_gateway_proxy_event_sets_attributes(self):
357359
handler_patch = mock.patch.dict(
358360
"os.environ",
359-
{_HANDLER: "mocks.lambda_function.rest_api_handler"},
361+
{_HANDLER: "tests.mocks.lambda_function.rest_api_handler"},
360362
)
361363
handler_patch.start()
362364

0 commit comments

Comments
 (0)