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