Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compatibility with patched python-json-logger on py3.12+ #100

Closed
wants to merge 2 commits into from
Closed
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
16 changes: 5 additions & 11 deletions tests/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io
import json
import logging
import sys
from datetime import datetime, timedelta, timezone
from unittest.mock import MagicMock

Expand Down Expand Up @@ -166,8 +165,7 @@ def test_emit():
"__metadata_version__": 1,
"something": "blah",
}
if sys.version_info >= (3, 12):
expected["taskName"] = None
event_capsule.pop("taskName", None)
assert event_capsule == expected


Expand Down Expand Up @@ -214,8 +212,7 @@ def test_message_field():
"something": "blah",
"message": "a message was seen",
}
if sys.version_info >= (3, 12):
expected["taskName"] = None
event_capsule.pop("taskName", None)
assert event_capsule == expected


Expand Down Expand Up @@ -263,8 +260,7 @@ def test_nested_message_field():
"__metadata_version__": 1,
"thing": {"message": "a nested message was seen"},
}
if sys.version_info >= (3, 12):
expected["taskName"] = None
event_capsule.pop("taskName", None)
assert event_capsule == expected


Expand Down Expand Up @@ -428,8 +424,7 @@ def test_unique_logger_instances():
"__metadata_version__": 1,
"something": "blah",
}
if sys.version_info >= (3, 12):
expected["taskName"] = None
event_capsule0.pop("taskName", None)
assert event_capsule0 == expected

event_capsule1 = json.loads(output1.getvalue())
Expand All @@ -443,8 +438,7 @@ def test_unique_logger_instances():
"__metadata_version__": 1,
"something": "blah",
}
if sys.version_info >= (3, 12):
expected["taskName"] = None
event_capsule1.pop("taskName", None)
assert event_capsule1 == expected


Expand Down
Loading