diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py index a2730028e8..f10953c754 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/tests/test_aws_lambda_instrumentation_manual.py @@ -17,13 +17,6 @@ from typing import Any, Callable, Dict from unittest import mock -from tests.mocks.api_gateway_http_api_event import ( - MOCK_LAMBDA_API_GATEWAY_HTTP_API_EVENT, -) -from tests.mocks.api_gateway_proxy_event import ( - MOCK_LAMBDA_API_GATEWAY_PROXY_EVENT, -) - from opentelemetry.environment_variables import OTEL_PROPAGATORS from opentelemetry.instrumentation.aws_lambda import ( _HANDLER, @@ -45,6 +38,11 @@ TraceContextTextMapPropagator, ) +from .mocks.api_gateway_http_api_event import ( + MOCK_LAMBDA_API_GATEWAY_HTTP_API_EVENT, +) +from .mocks.api_gateway_proxy_event import MOCK_LAMBDA_API_GATEWAY_PROXY_EVENT + class MockLambdaContext: def __init__(self, aws_request_id, invoked_function_arn): diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py index 2436aca40c..38759352b3 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor.py @@ -14,9 +14,6 @@ # pylint:disable=cyclic-import import grpc -from tests.protobuf import ( # pylint: disable=no-name-in-module - test_server_pb2_grpc, -) import opentelemetry.instrumentation.grpc from opentelemetry import trace @@ -41,6 +38,7 @@ simple_method_future, ) from ._server import create_test_server +from .protobuf import test_server_pb2_grpc from .protobuf.test_server_pb2 import Request diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py index 9a9aefad59..b6ae975dff 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_filter.py @@ -17,9 +17,6 @@ from unittest import mock import grpc -from tests.protobuf import ( # pylint: disable=no-name-in-module - test_server_pb2_grpc, -) import opentelemetry.instrumentation.grpc from opentelemetry import trace @@ -44,6 +41,7 @@ simple_method_future, ) from ._server import create_test_server +from .protobuf import test_server_pb2_grpc from .protobuf.test_server_pb2 import Request diff --git a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py index ca649f7bb1..aeecffc71c 100644 --- a/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py +++ b/instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py @@ -13,9 +13,6 @@ # limitations under the License. import grpc -from tests.protobuf import ( # pylint: disable=no-name-in-module - test_server_pb2_grpc, -) from opentelemetry import trace from opentelemetry.instrumentation.grpc import GrpcInstrumentorClient @@ -23,6 +20,7 @@ from ._client import simple_method from ._server import create_test_server +from .protobuf import test_server_pb2_grpc # User defined interceptor. Is used in the tests along with the opentelemetry client interceptor. diff --git a/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py b/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py index 35b672bac0..4e29091217 100644 --- a/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py +++ b/instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py @@ -24,15 +24,14 @@ MemcacheUnknownError, ) -# pylint: disable=import-error,no-name-in-module -from tests.utils import MockSocket, _str - from opentelemetry import trace as trace_api from opentelemetry.instrumentation.pymemcache import PymemcacheInstrumentor from opentelemetry.semconv.trace import SpanAttributes from opentelemetry.test.test_base import TestBase from opentelemetry.trace import get_tracer +from .utils import MockSocket, _str + TEST_HOST = "localhost" TEST_PORT = 117711