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