Skip to content

Commit

Permalink
Updated with name variable
Browse files Browse the repository at this point in the history
  • Loading branch information
k-macmillan committed Dec 3, 2024
1 parent e6505b2 commit 3911c20
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 3911c20

Please sign in to comment.