Close unclosed `MemoryObjectReceiveStream` in `TestClient` (#2693)

This commit is contained in:
Moataz Elmasry 2024-09-22 17:54:30 +01:00 committed by GitHub
parent 2d0dde8def
commit 6d70ad3ba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -784,7 +784,7 @@ class TestClient(httpx.Client):
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 (