Skip to content

Commit 4a40ac0

Browse files
committed
fix(tests): Use record.message instead of record.msg in log assertions
Root cause: When we converted f-strings to %s format strings in logger.warning(), the log record behavior changed: - f-strings: record.msg contains the fully formatted string - %s format: record.msg contains the template with %s placeholders record.message contains the formatted result The test was checking record.msg which now contains the unformatted template like 'Cannot set environment for new %s.' instead of the formatted message like 'Cannot set environment for new windows.' Fix: Changed assertions to use record.message (the proper way to access formatted log messages) instead of record.msg.
1 parent fea0198 commit 4a40ac0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/workspace/test_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def test_environment_variables_warns_prior_to_tmux_3_0(
457457
sum(
458458
1
459459
for record in caplog.records
460-
if "Cannot set environment for new windows." in record.msg
460+
if "Cannot set environment for new windows." in record.message
461461
)
462462
# From window_overrides and both_overrides, but not
463463
# both_overrides_in_first_pane.
@@ -467,7 +467,7 @@ def test_environment_variables_warns_prior_to_tmux_3_0(
467467
sum(
468468
1
469469
for record in caplog.records
470-
if "Cannot set environment for new panes." in record.msg
470+
if "Cannot set environment for new panes." in record.message
471471
)
472472
# From pane_overrides and both_overrides, but not both_overrides_in_first_pane.
473473
== 2
@@ -476,7 +476,7 @@ def test_environment_variables_warns_prior_to_tmux_3_0(
476476
sum(
477477
1
478478
for record in caplog.records
479-
if "Cannot set environment for new panes and windows." in record.msg
479+
if "Cannot set environment for new panes and windows." in record.message
480480
)
481481
# From both_overrides_in_first_pane.
482482
== 1

0 commit comments

Comments
 (0)