(sync: bool, client: Anthropic, async_client: AsyncAnthropic)
| 32 | @pytest.mark.asyncio |
| 33 | @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) |
| 34 | async def test_data_missing_event(sync: bool, client: Anthropic, async_client: AsyncAnthropic) -> None: |
| 35 | def body() -> Iterator[bytes]: |
| 36 | yield b'data: {"foo":true}\n' |
| 37 | yield b"\n" |
| 38 | |
| 39 | iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) |
| 40 | |
| 41 | sse = await iter_next(iterator) |
| 42 | assert sse.event is None |
| 43 | assert sse.json() == {"foo": True} |
| 44 | |
| 45 | await assert_empty_iter(iterator) |
| 46 | |
| 47 | |
| 48 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected