Skip to content

Commit 61e9b4c

Browse files
authored
Merge branch 'main' into fix-ipv6-url-credentials
2 parents a6ed42e + e640956 commit 61e9b4c

File tree

12 files changed

+31
-24
lines changed

12 files changed

+31
-24
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,4 +492,4 @@ min-public-methods=2
492492

493493
# Exceptions that will emit a warning when being caught. Defaults to
494494
# "Exception".
495-
overgeneral-exceptions=Exception
495+
overgeneral-exceptions=builtins.Exception

instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from unittest.mock import MagicMock
1818

1919
import aiopg
20+
import psycopg2
2021

2122
import opentelemetry.instrumentation.aiopg
2223
from opentelemetry import trace as trace_api
@@ -384,7 +385,9 @@ def test_span_failed(self):
384385
span.attributes[SpanAttributes.DB_STATEMENT], "Test query"
385386
)
386387
self.assertIs(span.status.status_code, trace_api.StatusCode.ERROR)
387-
self.assertEqual(span.status.description, "Exception: Test Exception")
388+
self.assertEqual(
389+
span.status.description, "ProgrammingError: Test Exception"
390+
)
388391

389392
def test_executemany(self):
390393
db_integration = AiopgIntegration(self.tracer, "testcomponent")
@@ -570,17 +573,17 @@ class MockCursor:
570573
# pylint: disable=unused-argument, no-self-use
571574
async def execute(self, query, params=None, throw_exception=False):
572575
if throw_exception:
573-
raise Exception("Test Exception")
576+
raise psycopg2.ProgrammingError("Test Exception")
574577

575578
# pylint: disable=unused-argument, no-self-use
576579
async def executemany(self, query, params=None, throw_exception=False):
577580
if throw_exception:
578-
raise Exception("Test Exception")
581+
raise psycopg2.ProgrammingError("Test Exception")
579582

580583
# pylint: disable=unused-argument, no-self-use
581584
async def callproc(self, query, params=None, throw_exception=False):
582585
if throw_exception:
583-
raise Exception("Test Exception")
586+
raise psycopg2.ProgrammingError("Test Exception")
584587

585588
def close(self):
586589
pass

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ def rest_api_handler(event, context):
2222

2323

2424
def handler_exc(event, context):
25+
# pylint: disable=broad-exception-raised
2526
raise Exception("500 internal server error")

instrumentation/opentelemetry-instrumentation-botocore/test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jsonschema==4.21.1
2828
jsonschema-specifications==2023.12.1
2929
junit-xml==1.9
3030
MarkupSafe==2.0.1
31-
moto==2.2.20
31+
moto==3.1.19
3232
mpmath==1.3.0
3333
networkx==3.1
3434
packaging==23.2

instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_dynamodb.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,14 @@ def test_get_item(self):
324324
Key={"id": {"S": "1"}},
325325
ConsistentRead=True,
326326
AttributesToGet=["id"],
327-
ProjectionExpression="1,2",
327+
ProjectionExpression="PE",
328328
ReturnConsumedCapacity="TOTAL",
329329
)
330330

331331
span = self.assert_span("GetItem")
332332
self.assert_table_names(span, self.default_table_name)
333333
self.assert_consistent_read(span, True)
334-
self.assert_projection(span, "1,2")
334+
self.assert_projection(span, "PE")
335335
self.assert_consumed_capacity(span, self.default_table_name)
336336

337337
@mock_dynamodb2
@@ -390,7 +390,7 @@ def test_query(self):
390390
}
391391
},
392392
ScanIndexForward=True,
393-
ProjectionExpression="1,2",
393+
ProjectionExpression="PE",
394394
ReturnConsumedCapacity="TOTAL",
395395
)
396396

@@ -403,7 +403,7 @@ def test_query(self):
403403
self.assert_consistent_read(span, True)
404404
self.assert_index_name(span, "lsi")
405405
self.assert_limit(span, 42)
406-
self.assert_projection(span, "1,2")
406+
self.assert_projection(span, "PE")
407407
self.assert_select(span, "ALL_ATTRIBUTES")
408408
self.assert_consumed_capacity(span, self.default_table_name)
409409

@@ -419,7 +419,7 @@ def test_scan(self):
419419
Select="ALL_ATTRIBUTES",
420420
TotalSegments=17,
421421
Segment=21,
422-
ProjectionExpression="1,2",
422+
ProjectionExpression="PE",
423423
ConsistentRead=True,
424424
ReturnConsumedCapacity="TOTAL",
425425
)
@@ -440,7 +440,7 @@ def test_scan(self):
440440
self.assert_consistent_read(span, True)
441441
self.assert_index_name(span, "lsi")
442442
self.assert_limit(span, 42)
443-
self.assert_projection(span, "1,2")
443+
self.assert_projection(span, "PE")
444444
self.assert_select(span, "ALL_ATTRIBUTES")
445445
self.assert_consumed_capacity(span, self.default_table_name)
446446

instrumentation/opentelemetry-instrumentation-dbapi/tests/test_dbapi_integration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,16 +419,19 @@ def __init__(self) -> None:
419419
# pylint: disable=unused-argument, no-self-use
420420
def execute(self, query, params=None, throw_exception=False):
421421
if throw_exception:
422+
# pylint: disable=broad-exception-raised
422423
raise Exception("Test Exception")
423424

424425
# pylint: disable=unused-argument, no-self-use
425426
def executemany(self, query, params=None, throw_exception=False):
426427
if throw_exception:
428+
# pylint: disable=broad-exception-raised
427429
raise Exception("Test Exception")
428430
self.query = query
429431
self.params = params
430432

431433
# pylint: disable=unused-argument, no-self-use
432434
def callproc(self, query, params=None, throw_exception=False):
433435
if throw_exception:
436+
# pylint: disable=broad-exception-raised
434437
raise Exception("Test Exception")

instrumentation/opentelemetry-instrumentation-grpc/tests/test_aio_client_interceptor_hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def response_hook(span, response):
4747

4848

4949
def request_hook_with_exception(_span, _request):
50-
raise Exception()
50+
raise Exception() # pylint: disable=broad-exception-raised
5151

5252

5353
def response_hook_with_exception(_span, _response):
54-
raise Exception()
54+
raise Exception() # pylint: disable=broad-exception-raised
5555

5656

5757
@pytest.mark.asyncio

instrumentation/opentelemetry-instrumentation-grpc/tests/test_client_interceptor_hooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ def response_hook(span, response):
7373

7474

7575
def request_hook_with_exception(_span, _request):
76-
raise Exception()
76+
raise Exception() # pylint: disable=broad-exception-raised
7777

7878

7979
def response_hook_with_exception(_span, _response):
80-
raise Exception()
80+
raise Exception() # pylint: disable=broad-exception-raised
8181

8282

8383
class TestHooks(TestBase):

instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def test_decorate_deque_proxy(
558558
self.assertEqual(res, evt)
559559
generator_info.pending_events.popleft.assert_called_once()
560560
extract.assert_not_called()
561-
context_get_current.not_called()
561+
context_get_current.assert_not_called()
562562
context_detach.assert_called_once()
563563
context_attach.assert_not_called()
564564
get_span.assert_not_called()

instrumentation/opentelemetry-instrumentation-psycopg/tests/test_psycopg_integration.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ def __init__(self, *args, **kwargs):
5353
# pylint: disable=unused-argument, no-self-use
5454
async def execute(self, query, params=None, throw_exception=False):
5555
if throw_exception:
56-
raise Exception("Test Exception")
56+
raise psycopg.Error("Test Exception")
5757

5858
# pylint: disable=unused-argument, no-self-use
5959
async def executemany(self, query, params=None, throw_exception=False):
6060
if throw_exception:
61-
raise Exception("Test Exception")
61+
raise psycopg.Error("Test Exception")
6262

6363
# pylint: disable=unused-argument, no-self-use
6464
async def callproc(self, query, params=None, throw_exception=False):
6565
if throw_exception:
66-
raise Exception("Test Exception")
66+
raise psycopg.Error("Test Exception")
6767

6868
async def __aenter__(self, *args, **kwargs):
6969
return self

0 commit comments

Comments
 (0)