From 3911c2015e9139f5d6dd260dedca123aa48a6bce Mon Sep 17 00:00:00 2001 From: Kyle MacMillan Date: Tue, 3 Dec 2024 14:35:14 -0500 Subject: [PATCH] Updated with name variable --- tests/test_logging.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_logging.py b/tests/test_logging.py index 2f46e318..bfc73ffd 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -122,9 +122,8 @@ def test_should_build_statsd_line_without_service_id_or_time_taken(): @pytest.mark.parametrize('app_name', ('notification-api', 'celery', None)) def test_get_handler_sets_up_logging_appropriately_with_debug(tmpdir, app, app_name): - logging.init_app(app) del app.config['NOTIFY_LOG_PATH'] - + app.name = app_name app.debug = True handler = logging.get_handler(app) @@ -134,7 +133,7 @@ def test_get_handler_sets_up_logging_appropriately_with_debug(tmpdir, app, app_n # application = app.config["NOTIFY_APP_NAME"] record = builtin_logging.makeLogRecord({ - "application": app.application, + "application": app.name, "args": ("Cornelius", 42), "levelname": "debug", "lineno": 1999, @@ -159,9 +158,8 @@ def test_get_handler_sets_up_logging_appropriately_without_debug(app, app_name): assert type(handler) is builtin_logging.StreamHandler assert type(handler.formatter) is JsonFormatter - application = app.config["NOTIFY_APP_NAME"] record = builtin_logging.makeLogRecord({ - "application": application, + "application": app.name, "args": ("Cornelius", 42), "levelname": "debug", "lineno": 1999,