Skip to content

Commit ded31f6

Browse files
Fix tests
1 parent 4b38118 commit ded31f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

opentelemetry-sdk/tests/logs/test_log_record.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
class TestLogRecord(unittest.TestCase):
4343
def test_serialized_context_none(self):
4444
record = LogRecord(context=None)
45-
self.assertEqual(None, record.serialized_context())
45+
self.assertEqual({}, record.serialized_context())
4646

4747
def test_serialized_context_serializable(self):
4848
context = {
@@ -81,7 +81,7 @@ def test_log_record_to_json(self):
8181
"dropped_attributes": 0,
8282
"timestamp": "1970-01-01T00:00:00.000000Z",
8383
"observed_timestamp": "1970-01-01T00:00:00.000000Z",
84-
"context": None,
84+
"context": {},
8585
"trace_id": "",
8686
"span_id": "",
8787
"trace_flags": None,
@@ -108,7 +108,7 @@ def test_log_record_to_json(self):
108108
self.assertEqual(expected, actual.to_json(indent=4))
109109
self.assertEqual(
110110
actual.to_json(indent=None),
111-
'{"body": "a log line", "severity_number": null, "severity_text": null, "attributes": {"mapping": {"key": "value"}, "none": null, "sequence": [1, 2], "str": "string"}, "dropped_attributes": 0, "timestamp": "1970-01-01T00:00:00.000000Z", "observed_timestamp": "1970-01-01T00:00:00.000000Z", "context": null, "trace_id": "", "span_id": "", "trace_flags": null, "resource": {"attributes": {"service.name": "foo"}, "schema_url": ""}}',
111+
'{"body": "a log line", "severity_number": null, "severity_text": null, "attributes": {"mapping": {"key": "value"}, "none": null, "sequence": [1, 2], "str": "string"}, "dropped_attributes": 0, "timestamp": "1970-01-01T00:00:00.000000Z", "observed_timestamp": "1970-01-01T00:00:00.000000Z", "context": {}, "trace_id": "", "span_id": "", "trace_flags": null, "resource": {"attributes": {"service.name": "foo"}, "schema_url": ""}}',
112112
)
113113

114114
# pylint: disable=too-many-locals

0 commit comments

Comments
 (0)