Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions tests/observability/core/test_record_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def test_record_attributes_with_dict(self):
self.assertEqual(span_attributes.get("custom.attribute.1"), "value1")
self.assertEqual(span_attributes.get("custom.attribute.2"), 42)
self.assertEqual(span_attributes.get("custom.attribute.3"), True)
print("✅ record_attributes with dict works correctly!")

def test_record_attributes_multiple_calls(self):
"""Test that multiple calls to record_attributes accumulate attributes."""
Expand All @@ -119,7 +118,6 @@ def test_record_attributes_multiple_calls(self):
self.assertEqual(span_attributes.get("batch1.key2"), "value2")
self.assertEqual(span_attributes.get("batch2.key1"), "value3")
self.assertEqual(span_attributes.get("batch2.key2"), "value4")
print("✅ Multiple calls to record_attributes accumulate correctly!")

def test_record_attributes_with_telemetry_disabled(self):
"""Test that record_attributes is a no-op when telemetry is disabled."""
Expand Down Expand Up @@ -147,8 +145,6 @@ def test_record_attributes_with_telemetry_disabled(self):
# Check if any span has our custom attribute (none should)
has_custom_key = any("custom.key" in (s.attributes or {}) for s in spans)
self.assertFalse(has_custom_key)

print("✅ record_attributes is no-op when telemetry disabled!")
finally:
# Restore telemetry state
if old_value is not None:
Expand Down Expand Up @@ -196,8 +192,6 @@ def test_opentelemetry_scope_logging(self, mock_logger):
span_ended_messages[0], r"Span ended: 'test_logging_activity' \([a-f0-9]{16}\)"
)

print("✅ OpenTelemetryScope logging test passed!")

@unittest.mock.patch("microsoft_agents_a365.observability.core.opentelemetry_scope.logger")
def test_opentelemetry_scope_error_logging(self, mock_logger):
"""Test that OpenTelemetryScope logs errors when span creation fails."""
Expand Down Expand Up @@ -228,6 +222,5 @@ def test_opentelemetry_scope_error_logging(self, mock_logger):
)



if __name__ == "__main__":
unittest.main()