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