diff --git a/tests/test_logger.py b/tests/test_logger.py index 8a0a499..ecd56ab 100644 --- a/tests/test_logger.py +++ b/tests/test_logger.py @@ -3,7 +3,6 @@ import io import json import logging -import sys from datetime import datetime, timedelta, timezone from unittest.mock import MagicMock @@ -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 @@ -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 @@ -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 @@ -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()) @@ -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