(sync: bool, client: Anthropic, async_client: AsyncAnthropic)
| 53 | @pytest.mark.asyncio |
| 54 | @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) |
| 55 | async def test_data_missing_event(sync: bool, client: Anthropic, async_client: AsyncAnthropic) -> None: |
| 56 | def body() -> Iterator[bytes]: |
| 57 | yield b'data: {"foo":true}\n' |
| 58 | yield b"\n" |
| 59 | |
| 60 | iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) |
| 61 | |
| 62 | sse = await iter_next(iterator) |
| 63 | assert sse.event is None |
| 64 | assert sse.json() == {"foo": True} |
| 65 | |
| 66 | await assert_empty_iter(iterator) |
| 67 | |
| 68 | |
| 69 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected