Open Enimalojd opened 2 hours ago
This output with a fix already applied:
async def wait_shutdown(self) -> None:
async def receive() -> typing.Any:
message = await self.stream_send.receive()
if message is None:
self.task.result()
return message
async with self.stream_send, self.stream_receive:
await self.stream_receive.send({"type": "lifespan.shutdown"})
message = await receive()
assert message["type"] in (
"lifespan.shutdown.complete",
"lifespan.shutdown.failed",
)
if message["type"] == "lifespan.shutdown.failed":
await receive()
An error occurred when running the tests. I studied the problems in the main Starlette package and noticed that you solved this problem there. But for some reason this solution does not help in Starlette-testclient.