Gate log notifications on the per-request log-level opt-in at 2026-07-28 (#3198)

This commit is contained in:
Max 2026-07-28 02:20:33 +01:00 • committed by GitHub
commit 89c5e700f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -283,6 +283,16 @@ async def test_connection_log_sends_logging_message_notification():
assert params["logger"] == "my.logger"
@pytest.mark.anyio
async def test_connection_log_sends_nothing_on_a_modern_connection():
"""2026 log delivery is a per-request opt-in on the requesting stream; the
connection-scoped standalone entry has no request to opt in, so it never sends."""
out = StubOutbound()
conn = Connection.from_envelope(LATEST_MODERN_VERSION, None, None, outbound=out)
await conn.log("emergency", "unheard") # pyright: ignore[reportDeprecated]
assert out.notifications == []
@pytest.mark.anyio
async def test_connection_log_with_meta_includes_meta_in_params():
out = StubOutbound()