Skip to content

Commit

Permalink
Close unclosed MemoryObjectReceiveStream in TestClient (encode#2693)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moataz-E authored and Rocky Allen committed Sep 30, 2024
1 parent 8248d07 commit d7ff369
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 d7ff369

Please sign in to comment.