Skip to content

Commit e9bf1f1

Browse files
committed
linting + test fix
1 parent b7749f8 commit e9bf1f1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/patches/_instrumentation_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
from logging import Logger, getLogger
66

7-
import pkg_resources # noqa: F401
7+
import pkg_resources # noqa: F401
88

99
from amazon.opentelemetry.distro._utils import is_installed
1010
from amazon.opentelemetry.distro.patches._resource_detector_patches import _apply_resource_detector_patches

aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_otlp_aws_span_exporter.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def setUp(self):
3939
]
4040

4141
self.invalid_otlp_tracing_endpoints = [
42-
"https://xray.bad-region-1.amazonaws.com/v1/traces",
4342
"https://xray.us-east-1.amaz.com/v1/traces",
4443
"https://logs.us-east-1.amazonaws.com/v1/logs",
4544
"https://test-endpoint123.com/test",
@@ -89,8 +88,7 @@ def test_sigv4_exporter_init_valid_cw_otlp_endpoint(self, session_mock):
8988
self.assertEqual(exporter._aws_region, "us-east-1")
9089
self.validate_exporter_extends_http_span_exporter(exporter, OTLP_XRAY_ENDPOINT)
9190

92-
@patch("botocore.session.Session")
93-
def test_sigv4_exporter_init_invalid_cw_otlp_endpoint(self, botocore_mock):
91+
def test_sigv4_exporter_init_invalid_cw_otlp_endpoint(self):
9492
"""Tests that the exporter constructor behavior is set by OTLP protobuf/http Span Exporter
9593
if an invalid OTLP CloudWatch endpoint is set"""
9694
for bad_endpoint in self.invalid_otlp_tracing_endpoints:
@@ -125,7 +123,8 @@ def test_sigv4_exporter_export_does_not_add_sigv4_if_not_valid_cw_endpoint(self,
125123
exporter = OTLPAwsSpanExporter(endpoint=OTLP_XRAY_ENDPOINT)
126124
exporter.export(self.testing_spans)
127125

128-
# For each invalid CW OTLP endpoint, vdalidate that SigV4 is not injected
126+
# For each invalid CW OTLP endpoint, validate that SigV4 is not injected
127+
self.invalid_otlp_tracing_endpoints.append("https://xray.bad-region-1.amazonaws.com/v1/traces")
129128
for bad_endpoint in self.invalid_otlp_tracing_endpoints:
130129
with self.subTest(endpoint=bad_endpoint):
131130
with patch.dict(os.environ, {OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: bad_endpoint}):

0 commit comments

Comments
 (0)