test(typespec-python): update streaming JSONL tests for type-driven Stream[T] - #5186
Closed
Libba Lawrence (l0lawrence) wants to merge 1 commit into
Closed
Conversation
…tream[T] Structured streaming is now type-driven in @typespec/http-client-python: an operation whose HTTP response is a JSONL/SSE stream generates receive() returning Stream[T]/AsyncStream[T] (Azure flavor) instead of Iterator[bytes]. Update the committed mock_api streaming tests to match: - shared/: keep only test_basic_send (recv now depends on flavor) - azure/test_streaming_structured.py: assert structured Stream[T] recv (guarded) - unbranded/: assert the byte-iterator recv (unbranded keeps Iterator[bytes]) Companion to microsoft/typespec#11579. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Libba Lawrence (l0lawrence)
deleted the
l0lawrence-streaming-type-driven-tests
branch
August 7, 2026 15:55
Contributor
|
❌ There is undocummented changes. Run The following packages have changes but are not documented.
Show changes |
Contributor
📦 Package size report1 package changed size compared to the base branch.
44 unchanged package(s)
Packed = gzipped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to microsoft/typespec#11579.
That PR makes structured streaming type-driven in
@typespec/http-client-python: an operation whose HTTP response is a JSONL (application/jsonl) or SSE (text/event-stream) stream now generatesreceive()returningStream[T]/AsyncStream[T](Azure flavor, from a vendored_utils/streaming_base.pyruntime) instead of the rawIterator[bytes]/AsyncIterator[bytes]. The unbranded flavor keeps the byte-iterator behavior.The committed
mock_apistreaming tests here assert the old byte contract for the azure flavor, so they break once the new core is swapped in by theMock API Testsintegration job. This PR updates them to match the new type-driven behavior:shared/test_streaming_jsonl.py(+ async): keep onlytest_basic_send—receive()now differs per flavor, so it is no longer a shared assertion.azure/test_streaming_structured.py(new): asserts the structuredStream[T]/AsyncStream[T]receive()for JSONL (homogeneousInfomodels) and SSE (homogeneous + heterogeneous, terminating at[DONE]). Imports are guarded so collection never errors when a package is absent.unbranded/test_streaming_jsonl_unbranded.py(+ async, new): asserts the unbranded byte-iteratorreceive().These mirror the equivalent tests in microsoft/typespec#11579. Should be merged together with (or right after) that PR.