Skip to content

Commit f93e25f

Browse files
test(harbor): use caplog.messages instead of LogRecord.message
Greptile on #20: .message is only set by Formatter.format(), which pytest's capture handler never calls; caplog.messages goes through getMessage() and is stable across pytest versions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 77772b9 commit f93e25f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

vero/tests/test_harbor_serve.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ def test_mode_b_sample_timeout_warns(caplog):
233233
)
234234
with caplog.at_level("WARNING"):
235235
_warn_mode_b_sample_timeout(ServeConfig(**base, sample_timeout=1200))
236-
assert any("not enforced in Mode B" in r.message for r in caplog.records)
236+
# caplog.messages (getMessage()) rather than r.message: pytest's capture
237+
# handler does not run Formatter.format(), so .message may be unset.
238+
assert any("not enforced in Mode B" in m for m in caplog.messages)
237239

238240
caplog.clear()
239241
with caplog.at_level("WARNING"):

0 commit comments

Comments
 (0)