Skip to content

Commit

Permalink
Close unclosed MemoryObjectReceiveStream in TestClient (#2693)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moataz-E committed Sep 22, 2024
1 parent 2d0dde8 commit 6d70ad3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starlette/testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ async def receive() -> typing.Any:
self.task.result()
return message

async with self.stream_send:
async with self.stream_send, self.stream_receive:
await self.stream_receive.send({"type": "lifespan.shutdown"})
message = await receive()
assert message["type"] in (
Expand Down

0 comments on commit 6d70ad3

Please sign in to comment.