Replies: 1 comment
-
can confirm this triggers just adding a simple config in a test: diff --git a/tests/unit/test_response/test_sse.py b/tests/unit/test_response/test_sse.py
index eade2426d..2e48ac2be 100644
--- a/tests/unit/test_response/test_sse.py
+++ b/tests/unit/test_response/test_sse.py
@@ -7,6 +7,7 @@ from httpx_sse import aconnect_sse
from litestar import get
from litestar.exceptions import ImproperlyConfiguredException
+from litestar.middleware.logging import LoggingMiddlewareConfig
from litestar.response import ServerSentEvent
from litestar.response.sse import ServerSentEventMessage
from litestar.testing import create_async_test_client
@@ -25,7 +26,7 @@ async def test_sse_steaming_response() -> None:
return ServerSentEvent(content=generator, event_id="123", event_type="special", retry_duration=1000)
- async with create_async_test_client(handler) as client:
+ async with create_async_test_client(handler, middleware=[LoggingMiddlewareConfig().middleware]) as client:
async with aconnect_sse(client, "GET", f"{client.base_url}/test") as event_source:
events = [sse async for sse in event_source.aiter_sse()]
assert len(events) == 5 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey. I'm not sure about a reason why the error occured
But if i exclude the sse endpoint then the logging middleware works well
Controller code
That is why i think logging SSE is not supported.
Beta Was this translation helpful? Give feedback.
All reactions