Visitar URL original
PYTHON-6045 Tighten the error.type test comments · mongodb/mongo-python-driver@d0ec2ff · GitHub
Skip to content

Commit d0ec2ff

Browse files
committed
PYTHON-6045 Tighten the error.type test comments
1 parent 95add1a commit d0ec2ff

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎test/asynchronous/test_otel.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ async def test_failure_records_exception_and_status_code(self):
561561

562562
@async_client_context.require_failCommand_fail_point
563563
async def test_error_type_is_exception_class_name_for_connection_failure(self):
564-
# A closed connection produces no server reply, so error.type falls back
565-
# to the exception's class name.
564+
# A closed connection produces no server reply, so error.type uses the class name.
566565
client = await self.async_rs_or_single_client(tracing={"enabled": True}, retryReads=False)
567566
fail_command = {
568567
"configureFailPoint": "failCommand",
@@ -579,12 +578,11 @@ async def test_error_type_is_exception_class_name_for_connection_failure(self):
579578
attrs = spans[0].attributes
580579
self.assertNotIn("db.response.status_code", attrs)
581580
self.assertEqual(attrs["error.type"], _qualified_name(type(ctx.exception)))
582-
# error.type and exception.type carry the same value on this path.
583581
self.assertEqual(attrs["error.type"], attrs["exception.type"])
584582

585583
@async_client_context.require_failCommand_blockConnection
586584
async def test_error_type_is_exception_class_name_for_network_timeout(self):
587-
# socketTimeoutMS trips before any reply, so again no server error code.
585+
# socketTimeoutMS trips before any reply, so there is no server error code.
588586
client = await self.async_rs_or_single_client(
589587
tracing={"enabled": True}, socketTimeoutMS=200, retryReads=False
590588
)

‎test/test_otel.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ def test_failure_records_exception_and_status_code(self):
561561

562562
@client_context.require_failCommand_fail_point
563563
def test_error_type_is_exception_class_name_for_connection_failure(self):
564-
# A closed connection produces no server reply, so error.type falls back
565-
# to the exception's class name.
564+
# A closed connection produces no server reply, so error.type uses the class name.
566565
client = self.rs_or_single_client(tracing={"enabled": True}, retryReads=False)
567566
fail_command = {
568567
"configureFailPoint": "failCommand",
@@ -579,12 +578,11 @@ def test_error_type_is_exception_class_name_for_connection_failure(self):
579578
attrs = spans[0].attributes
580579
self.assertNotIn("db.response.status_code", attrs)
581580
self.assertEqual(attrs["error.type"], _qualified_name(type(ctx.exception)))
582-
# error.type and exception.type carry the same value on this path.
583581
self.assertEqual(attrs["error.type"], attrs["exception.type"])
584582

585583
@client_context.require_failCommand_blockConnection
586584
def test_error_type_is_exception_class_name_for_network_timeout(self):
587-
# socketTimeoutMS trips before any reply, so again no server error code.
585+
# socketTimeoutMS trips before any reply, so there is no server error code.
588586
client = self.rs_or_single_client(
589587
tracing={"enabled": True}, socketTimeoutMS=200, retryReads=False
590588
)

0 commit comments

Comments
 (0)