Skip to content

Commit

Permalink
Test that MemoryObjectSendStream.send(falsey) raises BrokenResourceEr…
Browse files Browse the repository at this point in the history
…ror when all receive streams are closed
  • Loading branch information
gschaffner committed May 11, 2024
1 parent 96920b0 commit 2c22c6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/streams/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ async def test_close_send_while_receiving() -> None:


async def test_close_receive_while_sending() -> None:
send, receive = create_memory_object_stream[str](0)
# We send None here as a regression test for #731
send, receive = create_memory_object_stream[None](0)
with pytest.raises(ExceptionGroup) as exc:
async with create_task_group() as tg:
tg.start_soon(send.send, "hello")
tg.start_soon(send.send, None)
await wait_all_tasks_blocked()
await receive.aclose()

Expand Down

0 comments on commit 2c22c6a

Please sign in to comment.