Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Dec 22, 2023
1 parent 0e920cf commit 3bd9ab8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion newrelic/hooks/logger_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def wrap_callHandlers(wrapped, instance, args, kwargs):
if settings.application_logging.forwarding and settings.application_logging.forwarding.enabled:
try:
message = record.msg
if isinstance(message, dict):
if not isinstance(message, dict):
# Allow python to convert the message to a string and template it with args.
message = record.getMessage()

Expand Down
3 changes: 1 addition & 2 deletions tests/logger_logging/test_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"context.relativeCreated",
"context.thread",
],
forgone_attrs=["context.exc_info", "context.stack_info"], # Attributes not included by default
)
@validate_log_event_count(1)
@background_task()
Expand All @@ -61,7 +60,7 @@ def test_logging_extra_attributes(logger):
logger.error("extras", extra={"extra_attr": 1})


@validate_log_events([{"message": "exc_info"}], required_attrs=["context.exc_info"])
@validate_log_events([{"message": "exc_info"}], required_attrs=["context.exc_info", "context.exc_text"])
@validate_log_event_count(1)
@background_task()
def test_logging_exc_info_context_attributes(logger):
Expand Down
2 changes: 2 additions & 0 deletions tests/logger_logging/test_logging_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import pytest

from conftest import logger as conf_logger

from testing_support.fixtures import (
override_application_settings,
reset_core_stats_engine,
Expand Down

0 comments on commit 3bd9ab8

Please sign in to comment.