(sync: bool)
| 14 | @pytest.mark.asyncio |
| 15 | @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) |
| 16 | async def test_basic(sync: bool) -> None: |
| 17 | def body() -> Iterator[bytes]: |
| 18 | yield b'{"foo":true}\n' |
| 19 | yield b'{"bar":false}\n' |
| 20 | |
| 21 | iterator = make_jsonl_iterator( |
| 22 | content=body(), |
| 23 | sync=sync, |
| 24 | line_type=object, |
| 25 | ) |
| 26 | |
| 27 | assert await iter_next(iterator) == {"foo": True} |
| 28 | assert await iter_next(iterator) == {"bar": False} |
| 29 | |
| 30 | await assert_empty_iter(iterator) |
| 31 | |
| 32 | |
| 33 | @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) |
nothing calls this directly
no test coverage detected