chore: import upstream snapshot with attribution
Deploy Docs / deploy-docs (push) Failing after 1s
Conformance Tests / client-conformance (push) Failing after 3s
Conformance Tests / server-conformance (push) Failing after 1s
GitHub Actions Security Analysis / zizmor (push) Failing after 1s
CI / checks (push) Failing after 59m20s
CI / all-green (push) Waiting to run
Deploy Docs / deploy-docs (push) Failing after 1s
Conformance Tests / client-conformance (push) Failing after 3s
Conformance Tests / server-conformance (push) Failing after 1s
GitHub Actions Security Analysis / zizmor (push) Failing after 1s
CI / checks (push) Failing after 59m20s
CI / all-green (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"""Tests for the contextvars-carrying memory-stream wrappers."""
|
||||
|
||||
import anyio
|
||||
import pytest
|
||||
|
||||
from mcp.shared._context_streams import create_context_streams
|
||||
|
||||
pytestmark = pytest.mark.anyio
|
||||
|
||||
|
||||
async def test_sync_close_closes_the_underlying_streams() -> None:
|
||||
"""The wrappers mirror anyio's memory streams: close() is the sync form of aclose()."""
|
||||
send, receive = create_context_streams[str](1)
|
||||
await send.send("queued")
|
||||
send.close()
|
||||
receive.close()
|
||||
with pytest.raises(anyio.ClosedResourceError):
|
||||
await send.send("after close")
|
||||
with pytest.raises(anyio.ClosedResourceError):
|
||||
await receive.receive()
|
||||
Reference in New Issue
Block a user